R
Rider
Hi experts,
It has been a long time I fiddled with perl scripts.
I want to exclude all the lines that start with 0 and print only the
lines starting with non-zeroes.
Here is the script and I am not sure what is wrong here. Can some one
help me in correcting the syntax error here? Or even a short-cut like
one liner?
+++++++++++++++++++++
while(<DATA>)
{
if (^$_ == 0)
{
next;
print;
}
}
__DATA__
0 x.txt
0 y.txt
0 z.txt
101 z.txt
203 a:txt
303 l.txt
It has been a long time I fiddled with perl scripts.
I want to exclude all the lines that start with 0 and print only the
lines starting with non-zeroes.
Here is the script and I am not sure what is wrong here. Can some one
help me in correcting the syntax error here? Or even a short-cut like
one liner?
+++++++++++++++++++++
while(<DATA>)
{
if (^$_ == 0)
{
next;
print;
}
}
__DATA__
0 x.txt
0 y.txt
0 z.txt
101 z.txt
203 a:txt
303 l.txt