如何匹配if条件以/使用Perl开头? [英] How to match does the if condition starts with / using Perl?

查看:146
本文介绍了如何匹配if条件以/使用Perl开头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想匹配虱子开始的位置^ /。我该怎么做?





错误:



I want to match where the lice starts with ^/ .How can i do it?


Error:

Use of uninitialized value in bitwise xor (^) at

的按位xor(^)中使用未初始化的值



我尝试过的事情:



< pre



What I have tried:

<pre

open my $project_file, '<', $input_dir;
chomp(my @store_files = <$project_file>);
#print @store_files;
close $project_file;
foreach my $temp_line(@store_files)
{
if( $temp_line =~ /^EVISION_OCATION:/){
my @fetch_path=split (':',$temp_line);
my $new_path=$fetch_path[1];
print $new_path;
last;
}
}

if(my $new_path ^/)
{
$input_dir=$new_path;
}
else
{
$input_dir.=$new_path;
}

>

推荐答案

project_file,'<',
project_file, '<',


input_dir ;
chomp(我的@store_files =<
input_dir; chomp(my @store_files = <


project_file>);
#print @store_files;
关闭
project_file>); #print @store_files; close


这篇关于如何匹配if条件以/使用Perl开头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆