Greg,
I already tried that, it doesn't work. :(
When it gets to the ()[] it stops at once, with the error NO MATCH
I need to remove the ()[] before it gets read, or ARGV needs somekind of
option so it will ignore them.
Thanks
jose vazquez
[EMAIL PROTECTED]
On Thu, 3 May 2001, Greg Meckes wr
I think the problem is not with perl, but with your shell.
For the most shells () and [] are metacharacters (in bash [] is for
pattern matching and () is to fork a process, me thinks).
You either have to put the entire paramline into ''. Than you have
to alter your perl-programm, because you j
Couldn't you just do something simple like:
#at your "for" loop
for ($t=0;$t<$z;$t++) {
#Insert this
$zin[$t] =~ s/\[//g; #Remove left bracket
$zin[$t] =~ s/\]//g; #Remove right bracket
#End insert
#And continue with the rest...
if ($zin[$t] eq "212.104.202.50") { #etc
###
It'll
Use the 'g' switch so the pattern match is
$mystring =~ s/\'/\\'/g;
This 'g' says do it for all occurrences (I remember it by thinking of it
as the 'g' in 'globally').
Dan
"J. Patrick Lanigan" wrote:
>
> I was using:
>
> $mystring =~ s/\'/\\'/;
>
> ...to replace ' with \' in
I was using:
$mystring =~ s/\'/\\'/;
...to replace ' with \' in $mystring. It was working find I thought, until I
encountered a string with multiple apostrophies. How do I replace 0 or more?
Ex:
"No More 'I Love You's'"
...should become:
"No More \'I Love You\'s\'"
I
In your statements:
print "@zin[$i] \n\r";
You should use:
print "$zin[$i] \n\r";
And:
> $ta = @zin[6];
> $tb = @zin[7];
> $tc = @zin[8];
> $td = @zin[9];
should be:
> $ta = $zin[6];
> $tb = $zin[7];
> $tc = $zin[8];
> $td = $zin[9];
And:
if (@zin[$t] = /212.104.202.50/g) {
Should be:
if ($z
I didn't quite get what your problem was.
Can you elaborate on that?
There are a couple of newbie problems in your script:
> ##
> #!/usr/bin/perl
You should say:
!/usr/bin/perl -w
This turns on warnings (which is very helpful