Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Trying to Create and Write to a file

by c (Hermit)
on Apr 07, 2003 at 16:45 UTC ( [id://248670]=note: print w/replies, xml ) Need Help??


in reply to Trying to Create and Write to a file

I'm guessing that you'll need to chomp the value of $CorE after you've read it in from STDIN. You're trying to match on just the value 'C', when perl is probably seeing 'C\n' as its value.

-c

Replies are listed 'Best First'.
Re: Re: Trying to Create and Write to a file
by IPstacks (Novice) on Apr 07, 2003 at 16:48 UTC
    That did the trick, thanks c

      Just as a suggestion, you may also want to consider ignoring the case of the input. For example if someone enters 'c' then it doesn't pass the conditional. You could use a simple regex such as if ($CorE =~ /^C/i) which would also eliminate the need for chomping.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://248670]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-03-28 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found