Is it possible to assign a value to a variable and then do a substitution on it in a single statement? For example suppose I want to start with a URL, remove a known host-domain name, then assign the remaining dir/filename to a variable. With two statements you could say:
$dirfilename = $url; $dirfilename = s|http://foo.bar.com/||;
Originally posted as a Categorized Question.
In reply to How do I assign & substitute in one statement? by dfaure
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |