Re: chomp

2012-04-05 Thread Jim Gibson
On 4/5/12 Thu Apr 5, 2012 1:34 PM, "Somu" scribbled: > Hello everyone, > > #this code works for any valid input > # > use strict; > use warnings; > > print "\n\n\tEnter directory : "; > my $path = <>; > chomp($path);

chomp

2012-04-05 Thread Somu
Hello everyone, #this code works for any valid input # use strict; use warnings; print "\n\n\tEnter directory : "; my $path = <>; chomp($path); #but if this line is eliminated, it shows d drive(current drive) for any input my @files = glob "$path/*

Re: Chomp help...

2010-11-09 Thread Chandrashekar Bhat
Or chomp($VARNAME); # If you are sure enough of variable name. Thanks, Chandrashekar On Tue, Nov 9, 2010 at 3:05 AM, Bobby wrote: > Awsome, regex worked! My head was stuck on chomp...Thanks Sheppy. > > > > From: Sheppy R > To: Bobb

Re: Chomp help...

2010-11-08 Thread Bobby
Awsome, regex worked! My head was stuck on chomp...Thanks Sheppy. From: Sheppy R To: Bobby Cc: beginners@perl.org Sent: Mon, November 8, 2010 2:32:13 PM Subject: Re: Chomp help... You could try doing this with a regex: $html_content =~ s/\n//g; This would

Re: Chomp help...

2010-11-08 Thread Sheppy R
gt; > I'm having issues with printing out the content of a Database's HTML text > field; > I wanted to chomp out the carriage returns of the $html_content(see below) > so > that I could print it out all in one line into a text file ($output). I've > tried > chomp(

Re: Chomp help...

2010-11-08 Thread Shawn H Corey
On 10-11-08 04:04 PM, Bobby wrote: I'm having issues with printing out the content of a Database's HTML text field; I wanted to chomp out the carriage returns of the $html_content(see below) so that I could print it out all in one line into a text file ($output). I've tried

Chomp help...

2010-11-08 Thread Bobby
Hi, I'm having issues with printing out the content of a Database's HTML text field; I wanted to chomp out the carriage returns of the $html_content(see below) so that I could print it out all in one line into a text file ($output). I've tried chomp() but it doesn't

Re: chomp () function

2010-08-29 Thread Jim Gibson
At 8:17 PM +0530 8/29/10, Kaushal Shriyan wrote: I am referring to http://www.perl.org/books/beginning-perl/. so I am planning to read upto chapter 10. is it recommended to even go beyond chapter 10. Please suggest. I have not read that online resource, but looking at the contents I would re

Re: chomp () function

2010-08-29 Thread Kaushal Shriyan
On Sun, Aug 29, 2010 at 7:58 PM, Chas. Owens wrote: > On Sun, Aug 29, 2010 at 09:41, Kaushal Shriyan > wrote: > snip >> Thanks a lot Chas. Understood now. >> Also what does $_ default variable means exactly, any example would >> really help me understand it > snip > > The default variable is set

Re: chomp () function

2010-08-29 Thread Chas. Owens
On Sun, Aug 29, 2010 at 09:41, Kaushal Shriyan wrote: snip > Thanks a lot Chas. Understood now. > Also what does $_ default variable means exactly, any example would > really help me understand it snip The default variable is set or read by many Perl 5 functions. For instance, if you use the rea

Re: chomp () function

2010-08-29 Thread Kaushal Shriyan
gt; >>>> Can someone please explain me with an example of the usage chomp () >>>> builtin function in perl. >>> snip >>> >>> The chomp function removes whatever is in the $/ variable from the >>> argument passed in (or $_ if no argument is

Re: chomp () function

2010-08-29 Thread Chas. Owens
On Sun, Aug 29, 2010 at 09:23, Kaushal Shriyan wrote: > On Sun, Aug 29, 2010 at 6:11 PM, Chas. Owens wrote: >> On Sun, Aug 29, 2010 at 07:15, Kaushal Shriyan >> wrote: >>> Hi >>> >>> Can someone please explain me with an example of the usage chom

Re: chomp () function

2010-08-29 Thread Kaushal Shriyan
On Sun, Aug 29, 2010 at 6:11 PM, Chas. Owens wrote: > On Sun, Aug 29, 2010 at 07:15, Kaushal Shriyan > wrote: >> Hi >> >> Can someone please explain me with an example of the usage chomp () >> builtin function in perl. > snip > > The chomp function remo

Re: chomp () function

2010-08-29 Thread Chas. Owens
On Sun, Aug 29, 2010 at 07:15, Kaushal Shriyan wrote: > Hi > > Can someone please explain me with an example of the usage chomp () > builtin function in perl. snip The chomp function removes whatever is in the $/ variable from the argument passed in (or $_ if no argument is pass

Re: chomp () function

2010-08-29 Thread Shlomi Fish
On Sunday 29 August 2010 14:15:52 Kaushal Shriyan wrote: > Hi > > Can someone please explain me with an example of the usage chomp () > builtin function in perl. Yes, here you go. Let's suppose you want to write a small grep programs that only prints all lines ending with the c

chomp () function

2010-08-29 Thread Kaushal Shriyan
Hi Can someone please explain me with an example of the usage chomp () builtin function in perl. Thanks Kaushal -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

RE: chomp operator

2007-10-30 Thread RICHARD FERNANDEZ
> Hi, > Hello, > so where does the chomp operator plays its role, can some one > explain me here with a sample of code. > > Thanks and Regards > > Kaushal > One place where chomp() comes in handy is when you're reading from a file. Usually a line read from a

Re: chomp operator

2007-10-30 Thread yitzle
I find chomp() usefull for processing a file, or other input (eg keyboard). #!/usr/bin/perl use strict; use warnings; while(<>) { print "$_"; # $_ has a newline attached, either from file or STDIN chmop; doSomethingWithTheString($_); } -- To unsubscribe, e-mail: [EMAI

Re: chomp operator

2007-10-30 Thread Rob Coops
the end of those lines. So in order to save you a huge headache perl offers you the chomp operator to at least get rid of the line feeds. Regards, Rob On 10/30/07, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: > > Hi, > > I have the below lines of code. > > #!/usr/bin/perl &g

chomp operator

2007-10-30 Thread Kaushal Shriyan
Hi, I have the below lines of code. #!/usr/bin/perl use strict; use warnings; my $text =" a line of text\n" ; chomp($text); #the chomp operator gets rid of the newline character print "$text"; My question is if i remove the new line character "\n" in the above c

Re: arrays and chomp function

2007-07-29 Thread Bryan Harris
On 7/30/07, Rob Dixon <[EMAIL PROTECTED]> wrote: > Bryan Harris wrote: > > > > I'm not sure I understand why this is happening. Maybe someone can > > explain it to me. No matter how many times I use the chomp() function > > on my array, when I print t

Re: arrays and chomp function

2007-07-29 Thread Rob Dixon
Bryan Harris wrote: I'm not sure I understand why this is happening. Maybe someone can explain it to me. No matter how many times I use the chomp() function on my array, when I print the array it always prints the newlines. But I have another array, which will print without the newlines

Re: arrays and chomp function

2007-07-29 Thread Mr. Shawn H. Corey
Bryan Harris wrote: Hi, I'm not sure I understand why this is happening. Maybe someone can explain it to me. No matter how many times I use the chomp() function on my array, when I print the array it always prints the newlines. But I have another array, which will print without the new

arrays and chomp function

2007-07-29 Thread Bryan Harris
Hi, I'm not sure I understand why this is happening. Maybe someone can explain it to me. No matter how many times I use the chomp() function on my array, when I print the array it always prints the newlines. But I have another array, which will print without the newlines. In the first blo

Re: Why must I chomp a variable set in a script? (Problem Solved)

2007-06-18 Thread Jefferson Kirkland
-- Forwarded message -- From: Jefferson Kirkland <[EMAIL PROTECTED]> Date: Jun 18, 2007 10:45 AM Subject: Re: Why must I chomp a variable set in a script? (Problem Solved) To: Paul Lalli <[EMAIL PROTECTED]> Paul, On 6/18/07, Paul Lalli <[EMAIL PROTECTED]> wro

Re: Why must I chomp a variable set in a script?

2007-06-18 Thread Paul Lalli
> list. \n"); > > $subject = "Files To Retrieve In Directory: $dir \n"; > $recipients = $prefix . "Emails.txt"; > > `email program trigger`; > } > > I know that I said "wasn't" in my last statement. One of my colleagues

Why must I chomp a variable set in a script?

2007-06-18 Thread Jefferson Kirkland
on list. \n"); $subject = "Files To Retrieve In Directory: $dir \n"; $recipients = $prefix . "Emails.txt"; `email program trigger`; } I know that I said "wasn't" in my last statement. One of my colleagues discovered that if he pu

Re: Help on chomp()

2006-08-22 Thread Dr.Ruud
my $fh, '<', $fn or die "open '$fn': stopped $!" ; while ( <$fh> ) { chomp ; print "[$.>\n{$_}\n<$.]\n" ; } close $fh or die "close '$fn': stopped $!" ; -- Affijn, Ruud "Gewoon is een tij

Re: Help on chomp()

2006-08-22 Thread Tom Phoenix
On 8/22/06, Mazhar <[EMAIL PROTECTED]> wrote: > >> From the output i see the first character is missing in the output.. That could be caused by something erasing the first character after it's output to your screen. Send the output to a file, inspect the file (with 'hexdump -c', perhaps), and

Re: Help on chomp()

2006-08-22 Thread Mazhar
On 8/22/06, John W. Krahn <[EMAIL PROTECTED]> wrote: Mazhar wrote: > Dear Frndz, Hello, > I am writing the below code and i am facing a problem in chomp (its an > HP UX Box) > > Code > > #!/usr/bin/perl > >

Re: Help on chomp()

2006-08-21 Thread John W. Krahn
Mazhar wrote: > Dear Frndz, Hello, > I am writing the below code and i am facing a problem in chomp (its an > HP UX Box) > > Code > > #!/usr/bin/perl > > use strict; > use warnings; > my $file_name=$ARGV[0]; >

Re: Help on chomp()

2006-08-21 Thread Xavier Noria
On Aug 21, 2006, at 8:51 PM, Mazhar wrote: use strict; use warnings; my $file_name=$ARGV[0]; open(FILE,"$file_name") || die "Not been Accessed" ; No quotes needed around $file_name there. @host_array=; That variable was not declared before, so that script does not run because it does not

Help on chomp()

2006-08-21 Thread Mazhar
Dear Frndz, I am writing the below code and i am facing a problem in chomp (its an HP UX Box) Code #!/usr/bin/perl use strict; use warnings; my $file_name=$ARGV[0]; open(FILE,"$file_name") || die "Not been Accessed" ; @hos

Excuses (WAS: Chomp method)

2006-04-28 Thread Mr. Shawn H. Corey
On Fri, 2006-28-04 at 10:28 -0600, Chad Perrin wrote: > Ironic -- isn't it? Repetitions of "that", no apostrophe in "work's". > Actually, I think that's where I got that extraneous apostrophe that > snuck into the word "its" in another email of mine a few minutes ago. I > don't know if I stole it

Re: Chomp method

2006-04-28 Thread Chad Perrin
On Fri, Apr 28, 2006 at 11:05:23AM -0400, Mr. Shawn H. Corey wrote: > On Fri, 2006-28-04 at 07:33 -0700, Randal L. Schwartz wrote: > > > ""Mr" == "Mr Shawn H Corey" <[EMAIL PROTECTED]> writes: > > > > "Mr> Everyone should compliment their reading with experimentation and their > > "Mr> experim

Re: Chomp method

2006-04-28 Thread Mr. Shawn H. Corey
On Fri, 2006-28-04 at 07:33 -0700, Randal L. Schwartz wrote: > > ""Mr" == "Mr Shawn H Corey" <[EMAIL PROTECTED]> writes: > > "Mr> Everyone should compliment their reading with experimentation and their > "Mr> experimentation with reading. > > Do you mean "complement", or do you mean that you

Re: Chomp method

2006-04-28 Thread Randal L. Schwartz
> ""Mr" == "Mr Shawn H Corey" <[EMAIL PROTECTED]> writes: "Mr> Everyone should compliment their reading with experimentation and their "Mr> experimentation with reading. Do you mean "complement", or do you mean that you should say kind words about your reading? :) -- Randal L. Schwartz - St

Re: Reading List (WAS: Chomp method)

2006-04-27 Thread Chad Perrin
On Thu, Apr 27, 2006 at 12:20:22PM -0400, Mr. Shawn H. Corey wrote: > On Thu, 2006-27-04 at 11:03 -0500, Russ Foster wrote: > > Maybe I'll just buy a good reference book. ;-) > > I recommend "Zen and the Art of Motorcycle Maintenance : An Inquiry into > Values" by Robert M. Pirsig. Has nothing to

Re: Chomp method

2006-04-27 Thread Chad Perrin
On Thu, Apr 27, 2006 at 08:23:52AM -0400, [EMAIL PROTECTED] wrote: > > Although the "try it and see" approach is fun and intellectually > challenging, it really isn't productive for everyone. For example, I > wouldn't like to be paying a contractor who is getting paid per hour to > do a lot of "tr

Reading List (WAS: Chomp method)

2006-04-27 Thread Mr. Shawn H. Corey
On Thu, 2006-27-04 at 11:03 -0500, Russ Foster wrote: > Maybe I'll just buy a good reference book. ;-) I recommend "Zen and the Art of Motorcycle Maintenance : An Inquiry into Values" by Robert M. Pirsig. Has nothing to do with Perl or computers but is a good read anyway. -- __END__ Just my 0

Re: Chomp method

2006-04-27 Thread Mr. Shawn H. Corey
On Thu, 2006-27-04 at 08:18 -0700, Randal L. Schwartz wrote: > > ""Mr" == "Mr Shawn H Corey" <[EMAIL PROTECTED]> writes: > "Mr> A good way to learn how a function works is to write a small program to > "Mr> test it. There is nothing like hands-on experience. > > Unless your experience doesn't

RE: Chomp method

2006-04-27 Thread Russ Foster
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of > > > Instead of the perldoc chomp example of: > > It sounds as if you have ideas on how to improve the Perl > documentation. I heartily encourage you to contribute your > i

Re: Chomp method

2006-04-27 Thread Tom Phoenix
On 4/27/06, Russ Foster <[EMAIL PROTECTED]> wrote: > Instead of the perldoc chomp example of: It sounds as if you have ideas on how to improve the Perl documentation. I heartily encourage you to contribute your improvements by means of the perlbug program, which comes with Perl. A pat

RE: Chomp method

2006-04-27 Thread Russ Foster
rstanding. That's because I'm not (completely) against your point. ;-) However, the original question was: <<< I am wondering how the chomp function works. I am looking to see how I can truncate new line and/or carriage returns from a string. Will chomp do nothing if there a

Re: Chomp method

2006-04-27 Thread Randal L. Schwartz
> "Russ" == Russ Foster <[EMAIL PROTECTED]> writes: Russ> But that's exactly why you need to try it and see. The more a document Russ> spends on the arcane details of a function (which perldoc does), the more Russ> likely a beginner would get lost in those details and find some other source R

RE: Chomp method

2006-04-27 Thread Russ Foster
> -Original Message- > From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] > > For example, almost no amount of experimentation will stumble across > how chomp actually removes $/, not just "\n". But that's exactly why you need to try it and see. The more a

RE: Chomp method

2006-04-27 Thread Ron Goral
> -Original Message- > From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] > Sent: Thursday, 27 April, 2006 10:18 > To: beginners@perl.org > Subject: Re: Chomp method > > > For example, almost no amount of experimentation will stumble across > how chomp actual

Re: Chomp method

2006-04-27 Thread Randal L. Schwartz
a function works is to write a small program to "Mr> test it. There is nothing like hands-on experience. Unless your experience doesn't stumble across the corner cases. Nothing can replace reading a good specification. For example, almost no amount of experimentation will stu

How To Post (WAS: Chomp method)

2006-04-27 Thread Mr. Shawn H. Corey
On Thu, 2006-27-04 at 08:23 -0400, [EMAIL PROTECTED] wrote: > I'd have to say that I disagree with this approach - as mentioned by > several people here... > > Although the "try it and see" approach is fun and intellectually > challenging, it really isn't productive for everyone. For example, I >

RE: Chomp method

2006-04-27 Thread Russ Foster
Great article! Thanks for the reference. -r > -Original Message- > From: Chad Perrin [mailto:[EMAIL PROTECTED] > > > > A good way to learn how a function works is to write a small program to > > test it. There is nothing like hands-on experience. > > . . . or "Apply the T.I.T.S. principl

references header Was: Chomp method

2006-04-27 Thread Bjørge Solli
On Thursday 27 April 2006 14:23, you([EMAIL PROTECTED]) wrote: > I'd have to say that I disagree with this approach - as mentioned by > several people here... I must say you have a point, but it would be *a lot* easier to understand what you disagree with if you choose (at least) one of the foll

RE: Chomp method

2006-04-27 Thread Richard.Copits
to carry a cat by its tail learns something that will always be useful and which will never grow dim or doubtful." Mark Twain -Original Message- From: Chad Perrin [mailto:[EMAIL PROTECTED] Sent: Thursday, April 27, 2006 7:55 AM

Re: Chomp method

2006-04-27 Thread Chad Perrin
On Thu, Apr 27, 2006 at 07:25:15AM -0400, Mr. Shawn H. Corey wrote: > On Wed, 2006-26-04 at 23:07 -0700, Jaime Murillo wrote: > > The good way to learn how a function works is to use the perldoc utility. > > A good way to learn how a function works is to write a small program to > test it. There i

Re: Chomp method

2006-04-27 Thread Mr. Shawn H. Corey
On Wed, 2006-26-04 at 23:07 -0700, Jaime Murillo wrote: > The good way to learn how a function works is to use the perldoc utility. A good way to learn how a function works is to write a small program to test it. There is nothing like hands-on experience. -- __END__ Just my 0.0002 million

Re: Chomp method

2006-04-26 Thread John W. Krahn
AndrewMcHorney wrote: > Hello Hello, > I am wondering how the chomp function works. I am looking to see how I > can truncate new line and/or carriage returns from a string. Will chomp > do nothing if there are no carriage return or line feed at the end. If > the end of the str

Re: Chomp method

2006-04-26 Thread Jaime Murillo
On Wednesday 26 April 2006 22:51, AndrewMcHorney wrote: > Hello Hey Andrew > > I am wondering how the chomp function works. I am looking to see how > I can truncate new line and/or carriage returns from a string. Will > chomp do nothing if there are no carriage return or line fe

Re: Chomp method

2006-04-26 Thread nishanth ev
Hello, The chomp function will chomp off the last character if its a new line. Spaces wont be truncated by chomp. Regards Nishanth > Hello > > I am wondering how the chomp function works. I am > looking to see how > I can truncate new line and/or carriage returns from &

Chomp method

2006-04-26 Thread AndrewMcHorney
Hello I am wondering how the chomp function works. I am looking to see how I can truncate new line and/or carriage returns from a string. Will chomp do nothing if there are no carriage return or line feed at the end. If the end of the string has a space will it leave it alone? Andrew

Re: chop/chomp/?

2005-12-08 Thread Xavier Noria
On Dec 8, 2005, at 16:35, Frank Bax wrote: What's the correct way to trim trailing newlines from a text file that might be either DOS or UNIX format for newlines? The docs (and my experience) is that chomp only works properly if the text file is native to the current operating system?

Re: chop/chomp/?

2005-12-08 Thread Bob Showalter
Frank Bax wrote: What's the correct way to trim trailing newlines from a text file that might be either DOS or UNIX format for newlines? The docs (and my experience) is that chomp only works properly if the text file is native to the current operating system? I'm running on *

Re: chop/chomp/?

2005-12-08 Thread Shawn Corey
Frank Bax wrote: What's the correct way to trim trailing newlines from a text file that might be either DOS or UNIX format for newlines? The docs (and my experience) is that chomp only works properly if the text file is native to the current operating system? I'm running on *

chop/chomp/?

2005-12-08 Thread Frank Bax
What's the correct way to trim trailing newlines from a text file that might be either DOS or UNIX format for newlines? The docs (and my experience) is that chomp only works properly if the text file is native to the current operating system? I'm running on *bsd system. -- To unsu

Re: chomp and chop

2005-11-16 Thread Edward WIJAYA
On Thu, 17 Nov 2005 10:10:17 +0800, The Ghost <[EMAIL PROTECTED]> wrote: I have some code that chomps a variable, but the variable still seems to have a newline. But if I chop it I am rid of the newline. What's going on with that string? Perhaps that newline is Windows specific (like \

chomp and chop

2005-11-16 Thread The Ghost
I have some code that chomps a variable, but the variable still seems to have a newline. But if I chop it I am rid of the newline. What's going on with that string? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: losing a value after chomp()

2005-01-18 Thread Tor Hildrum
On Tue, 18 Jan 2005 15:15:00 +, RichT <[EMAIL PROTECTED]> wrote: > Grate that worked, the varible must of have a \r and a \n at the end. > thank you very much... > > how would i find our what escape chars are in a varible? > or is there a way to print out a string with out perl translating th

Re: losing a value after chomp()

2005-01-18 Thread RichT
On Tue, 18 Jan 2005 15:30:42 +0100, Tor Hildrum <[EMAIL PROTECTED]> wrote: > On Tue, 18 Jan 2005 13:22:14 +, RichT <[EMAIL PROTECTED] > wrote: > > Hi again, > > ok i made the changes sugested, but something is still wrong. > > the output im getting is > > -

Re: losing a value after chomp()

2005-01-18 Thread Tor Hildrum
On Tue, 18 Jan 2005 13:22:14 +, RichT <[EMAIL PROTECTED]> wrote: > Hi again, > ok i made the changes sugested, but something is still wrong. > the output im getting is > -- > "interface is "ATM0 > "interface is "A

Re: losing a value after chomp()

2005-01-18 Thread RichT
ace is "ATM0.38 -- ie the " is at the start of the line??? i think this is some thing to do with the way Cisco::Reconfig is returning the values, becouse this happens every time i chomp a value i get from it. any one why this might be happening? yours most con

Re: losing a value after chomp()

2005-01-17 Thread Tor Hildrum
ork, but i am lost (i suspect > some basic Perl knowledge is missing). > any help would be most appreciated thank you . chomp($var); is perfectly valid. Try this code: > sub getPortFromFullInterface { > my $part = shift; print "I'm inside getPortFromFullI

losing a value after chomp()

2005-01-17 Thread RichT
t;dir/$routerName.cfg"); for my $interfaceTypes (split/\,/,$findInterfaces) { #loop throught interface types for my $found ($config->get('interface')->all($interfaceTypes)) { # loop through found interfaces $interface=getPortFromFullInterface("$found") || die "$!"

RE: New Line / Chomp Query

2004-07-25 Thread David Clarke
Codes goes along this way : $current_record = $_; if (substr($current_record, 0, 6) eq 'GRSUMC') { # Remove new line marker chomp($current_record = $current_record); # Attach run no to end of record $current_record = $current_record . $ru

Re: New Line / Chomp Query

2004-07-23 Thread James Edward Gray II
On Jul 23, 2004, at 7:56 AM, Bob Showalter wrote: Thanks. Is translation to LF performed on input/output (a la Windows), or is $/ set to CR on those systems? No translation. $/ was set to CR and even \n gave you a CR. Luckily, as I said before, Mac OS X is a much more native Perl, being in the U

RE: New Line / Chomp Query

2004-07-23 Thread Bob Showalter
James Edward Gray II wrote: > On Jul 23, 2004, at 7:16 AM, Bob Showalter wrote: > > > On Mac systems, the terminator is something different (not sure > > what), but the same concept applies as for Windows AFAIK. > > Mac OS 9 and below used a single CR (0x0D) as the line terminator. Thanks. Is t

Re: New Line / Chomp Query

2004-07-23 Thread James Edward Gray II
On Jul 23, 2004, at 7:16 AM, Bob Showalter wrote: On Mac systems, the terminator is something different (not sure what), but the same concept applies as for Windows AFAIK. Mac OS 9 and below used a single CR (0x0D) as the line terminator. Mac OS X is a "Unix-ish system", as you described it, and

RE: New Line / Chomp Query

2004-07-23 Thread Bob Showalter
each line. On Mac systems, the terminator is something different (not sure what), but the same concept applies as for Windows AFAIK. > > I'm trying to read in a line of text, chomp it, attach 3 digits at > the end of this line, then write this line to output file. But when I &g

New Line / Chomp Query

2004-07-22 Thread David Clarke
Hi, does anyone know what the new line character value is in Hex for a text file ? Is it "0d 0a" ? I'm trying to read in a line of text, chomp it, attach 3 digits at the end of this line, then write this line to output file. But when I write it out, the original input line

Re: find command (chomp)

2004-06-17 Thread Wiggins d Anconia
Please group reply... > before chomping the find command did not work as the > extracted username has a end of line(or somthing I > donno). I gave a email before this and expecting you > mail to get me out of trouble.Thank you. > > > > chomp($Hme); > > chomp

Re: newbie question about chomp...

2004-02-22 Thread WC -Sx- Jones
=pod ( R i c a r d o P i c h l e r ) wrote: Hi people, I can't make this work... foreach $input() { chomp $input; print "$input\n"; } =cut # hopefully it was previously opened. while() { chomp; s/^\s//; s/\s$//; print "$_"; } __END__ All this was aske

newbie question about chomp...

2004-02-22 Thread R i c a r d o P i c h l e r
Hi people, I can't make this work... foreach $input() { chomp $input; print "$input\n"; } But with this, I do... foreach $input() { $input =~ s/\n//; $input =~ s/\r//; print "$input\n"; } In first example, print two new line, in second work fine pr

newbie question about chomp...

2004-02-22 Thread R i c a r d o P i c h l e r
Hi people, i don Ricardo Pichler -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: chmod -- chomp not chmod!!

2003-09-08 Thread R. Joseph Newton
Christiane Nerz wrote: > Oh-oh - there was a mistake - I tried chomp, not chmod.. > How do I use chomp correctly? I have an array of strings, want to cut > off the last \n in each line and use the rest of the line. (concatenate > it to another string) > Jane > Return to t

Re: chmod -- chomp not chmod!!

2003-09-04 Thread Sudarshan Raghavan
Christiane Nerz wrote: Oh-oh - there was a mistake - I tried chomp, not chmod.. How do I use chomp correctly? I have an array of strings, want to cut off the last \n in each line and use the rest of the line. (concatenate it to another string) Jane Hi all! I like to read several rows out of

Re: chmod -- chomp not chmod!!

2003-09-04 Thread Christiane Nerz
Oh-oh - there was a mistake - I tried chomp, not chmod.. How do I use chomp correctly? I have an array of strings, want to cut off the last \n in each line and use the rest of the line. (concatenate it to another string) Jane Hi all! I like to read several rows out of two different table-files

CHOMP and {$query->param( question...

2003-06-23 Thread Gregg O'Donnell
I have a Publication Order Form, with checkboxes beside each title. The list needs to be emailed to ONLY the department that carries the publication ordered (not all departments). I think I should I grab the form data, use CHOMP to get only "fire" from "fire-01" but then

Re: issue with chomp - chop need to trim()

2002-09-10 Thread david
Janek Schleicher wrote: > That's why the first one is only a matching, > while the second one is a substitution, > really removing something. > the first one is actually a syntax error. david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: issue with chomp - chop need to trim()

2002-09-10 Thread Sudarshan Raghavan
> the chomp(EXP) function remove the last character from EXP(or $_) only if > that character is a newline for your OS. chomp() knows what newline your OS > uses so you don't have to worry about it. again, chomp doesn't remove > spaces(unless you happen to treat newline

Re: issue with chomp - chop need to trim()

2002-09-09 Thread Janek Schleicher
David wrote at Tue, 10 Sep 2002 03:22:52 +0200: >>> $line =~ /^\s+//; >> >>> $line =~ s/^\s+//; ^ > > even after looking at your reply for 20 seconds, i still didn't see the > differences... :-) how stupid i am? thanks for spot that. The difference is that the first one doesn't h

Re: issue with chomp - chop need to trim()

2002-09-09 Thread rob
d of your string, chop will remove it for you, but >if you have many spaces at the end, only one will be removed. > >the chomp(EXP) function remove the last character from EXP(or $_) only if >that character is a newline for your OS. chomp() knows what newline your OS >uses so yo

Re: issue with chomp - chop need to trim()

2002-09-09 Thread david
John W. Krahn wrote: >> $line =~ /^\s+//; > >> $line =~ s/^\s+//; even after looking at your reply for 20 seconds, i still didn't see the differences... :-) how stupid i am? thanks for spot that. david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Re: issue with chomp - chop need to trim()

2002-09-09 Thread Michael Fowler
On Mon, Sep 09, 2002 at 08:04:24PM -0500, dizzy74 wrote: [snip] > I did perldoc -q trim and nothing. Of course chop and chomp were there > but diddnt seem to work in a pinch (or I couldnt understand how to apply > the function in my case. The FAQ entry you're looking for is per

Re: issue with chomp - chop need to trim()

2002-09-09 Thread John W. Krahn
David wrote: > > to trim spaces, try: > > $line ="\t\tabcd\t \t\n"; > $line =~ /^\s+//; $line =~ s/^\s+//; > $line =~ /\s+$//; #-- also remove \n $line =~ s/\s+$//; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Re: issue with chomp - chop need to trim()

2002-09-09 Thread John W. Krahn
p blank space from the beginning/end of a string? > Looked on the web The Perl documentation should have been installed on your hard disk when you installed Perl. > and found basicaly perl uses either chop or chomp each > with their own features. chop() removes the last character o

Re: issue with chomp - chop need to trim()

2002-09-09 Thread david
Dizzy74 wrote: > > open(FILE,"F:\\test_db\\Admin\\MINIHI\\DEF\\prog_list.txt"|| die "cant > open file") ; > chomp(@tblname = ); > open (outfile, ">F:\\test_db\\Admin\\MINIHI\\DEF\\INSERTprog_list.sql"|| > die "cant open file") ; >

issue with chomp - chop need to trim()

2002-09-09 Thread dizzy74
Hi All Today I was trying to do some work with perl and needed to use a function that would trim leading or trailing spaces from a string. Looked on the web and found basicaly perl uses either chop or chomp each with their own features. When I tried to apply it to my $var it either

Re: shifting solved (was "Re: chomp-ing DOS lines, shifting, and a variable variable")

2002-06-09 Thread David T-G
Timothy, et al -- ...and then Timothy Johnson said... % % David->"Hmmm... OK, so that explains it, but I still don't get it... So % the match is going to spit out a scalar but in order to use it you have to % capture it in a list context?" % % No, actually the opposite. The match returns a l

RE: shifting solved (was "Re: chomp-ing DOS lines, shifting, and a variable variable")

2002-06-09 Thread Timothy Johnson
ject: Re: shifting solved (was "Re: chomp-ing DOS lines, shifting, and a variable variable") Timothy, et al -- and then Timothy Johnson said... % % Ok, I finally got a chance to test it, and the problem with my code is that % split expects a scalar as the second argument. T

Re: shifting solved (was "Re: chomp-ing DOS lines, shifting, and a variable variable")

2002-06-09 Thread David T-G
Timothy, et al -- ...and then Timothy Johnson said... % % Ok, I finally got a chance to test it, and the problem with my code is that % split expects a scalar as the second argument. This does work: % % ($temp) = $fullpath =~ m:/mp3/(.+):; % @working = split /\//,$temp; % % because it is

RE: shifting solved (was "Re: chomp-ing DOS lines, shifting, and a variable variable")

2002-06-09 Thread Timothy Johnson
Try this: @working = split(/\//,($fullpath =~ m:/mp3/(.+):)[0]); -Original Message- From: David T-G [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 09, 2002 1:43 PM To: perl beginners Cc: Timothy Johnson Subject: Re: shifting solved (was "Re: chomp-ing DOS lines, shifting, and a variabl

Re: shifting solved (was "Re: chomp-ing DOS lines, shifting, and a variable variable")

2002-06-09 Thread David T-G
Timothy, et al -- ...and then David T-G said... % % ...and then Timothy Johnson said... % % % % I can't test this where I am right now, but would something like this work? % % % % @working = split /\//,($fullpath =~ m|/mp3/(.+)|); #changed match delimiter % % I'm surprised to find that it doe

Re: shifting solved (was "Re: chomp-ing DOS lines, shifting, and a variable variable")

2002-06-09 Thread David T-G
Timothy, et al -- ...and then Timothy Johnson said... % % I can't test this where I am right now, but would something like this work? % % @working = split /\//,($fullpath =~ m|/mp3/(.+)|); #changed match delimiter I'm surprised to find that it does, but I'm glad I tested it. I thought that ma

  1   2   >