Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

chop() and chomp()

by Parham (Friar)
on Jan 01, 2002 at 04:23 UTC ( #135462=perltutorial: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #chomp() EXAMPLES
    $a = "abcdefghij";
    ...
    $a = "abcdefghij";
    $b = chop($a);
    print $b;  #this would return 'j'
    
  2. or download this
    $a = "abcdefghij\n";
    if ($a =~ /\n$/) { chop $a; } #this could also be \r\n if on windows p
    +latform
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perltutorial [id://135462]
help
Chatterbox?
[atcroft]: abner: Or are you wanting to do something where you need to bind an array to a placeholder (in which case the bind_param_array method may be of use.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-01-24 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (202 votes). Check out past polls.