cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
But is there a way to do the same thing in one statement?$dirfilename = $url; $dirfilename = s|http://foo.bar.com/||;
will not work because this does the substitution on $url then assigns a 1 to $dirfilename to indicate the successful substitution.$dirfilename = $url =~ s|http://foo.bar.com/||;
Many thanks....
Steve
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Assign & substitute in one statement?
by Zaxo (Archbishop) on Jun 13, 2004 at 22:09 UTC | |
by Aragorn (Curate) on Jun 14, 2004 at 11:23 UTC | |
by edan (Curate) on Jun 14, 2004 at 12:44 UTC | |
Re: Assign & substitute in one statement?
by kesterkester (Hermit) on Jun 13, 2004 at 22:04 UTC | |
Re: Assign & substitute in one statement?
by dfaure (Chaplain) on Jun 14, 2004 at 06:37 UTC | |
Re: Assign & substitute in one statement?
by Anonymous Monk on Jun 14, 2004 at 18:27 UTC | |
by Anonymous Monk on Jun 15, 2004 at 22:39 UTC |