Tryin to noodle this out and looking for a some help. Basically, I want to set a value to the match for a regex, UNLESS it didnt' match, and then I want to set a default value for this var.. e.g.</p.
...snip... if( $string =~ /foobar/ ) { $match = $1 unless undef then $match = "chiapet"; ]
Now, obviously this silly code doesn't work, but how would I go about acheieving this? Thanks a lot in advance.
In reply to Regex question by carric
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |