home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!decwrl!bu.edu!Shiva.COM!world!dsb
- From: dsb@world.std.com (David Boyce)
- Newsgroups: comp.lang.perl
- Subject: Re: help with if ( ! $a =~ /##/ ) PLEASE!!!
- Message-ID: <Bto5Lw.63K@world.std.com>
- Date: 28 Aug 92 01:03:31 GMT
- References: <ericw.714945775@bach>
- Distribution: usa
- Organization: The World Public Access UNIX, Brookline, MA
- Lines: 24
-
- In article <ericw.714945775@bach> ericw@bach.amd.com (Eric Wedaa) writes:
- >I am having a h!@# of a time getting this code fragment to
- >work:
- >
- >if ( ! $a =~ /#/ ){
- > some_random_bit_of_perl;
- >}
- >
- >It never does anything! What I want it to do is if $a does not
- >have "#" in it, then it should do "some_random_bit_of_perl;"
- >
- >What fundamental thing am I missing?
-
- Precedence rules. Put parens around the conditional:
-
- if ( ! ($a =~ /#/)){
-
- >Silly question of the day... (And I know that 15 minutes
- >after I post this, and it goes out through the ether, I'll
- >probably figure it out myself.)
-
- And 15 minutes after that the net will be deluged with answers.
- --
- David Boyce dsb@world.std.com 617-576-1540
-