ivanatora has asked for the wisdom of the Perl Monks concerning the following question:
Here is the function:if ($line =~ /blablabla :(.+?): bleblable/){ $my_var = fixn($1); do_whatever_I_want_with($my_var); }
I have the feeling, that backslashes are lost in my $str = "@_"; <= that quotes turn them into a escape sequences.sub fixn($){ my $str = "@_"; $str =~ s/[^a-zA-Z0-9^_\-\\`\.\[\]\{\}~]//g; chomp $str; return $str; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with interpolating backslash
by Joost (Canon) on Aug 20, 2005 at 12:22 UTC | |
by pg (Canon) on Aug 20, 2005 at 16:06 UTC | |
by ivanatora (Sexton) on Aug 20, 2005 at 17:27 UTC | |
by Roger (Parson) on Aug 20, 2005 at 23:04 UTC | |
|
Re: Problem with interpolating backslash
by davido (Cardinal) on Aug 20, 2005 at 15:56 UTC |