neversaint has asked for the wisdom of the Perl Monks concerning the following question:
Now, the problem is that in various Linux box the string ($tm) may have different endings:my @output = `./some_executable.out -f $some_param`; my %nhash; foreach my $output (@output) { chomp($output); my ( $tm, $val ) = split( " ", $output ); print "BEFORE: $tm\n"; # this regex is not robust because it can't capture « $tm =~ s/L//; print "AFTER: $tm\n"; $nhash{$tm} = $val; }
depending on CPU I'm using. My question are:# sometime this: $tm = 'fooL'; # other time this: $tm = 'foo«';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex for replacing hidden character: « and L
by davido (Cardinal) on Mar 18, 2006 at 05:13 UTC | |
|
Re: Regex for replacing hidden character: « and L
by GrandFather (Saint) on Mar 18, 2006 at 05:18 UTC | |
by virtualsue (Vicar) on Mar 18, 2006 at 06:30 UTC | |
|
Re: Regex for replacing hidden character: « and L
by graff (Chancellor) on Mar 18, 2006 at 22:56 UTC |