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); #but if this line is eliminated, it > shows d driv

Re: chomp ?

2001-06-26 Thread Chris Hedemark
I'm usually the last person to say this (in fact I think it is the first time I've ever ever felt the need to say this) but "RTFM". If you can't find this on your own you are either too lazy to warrant help, or too dumb to absorb the help that is given. You Wrote: -- What is chomp ?

Re: chomp ?

2001-06-26 Thread Brett W. McCoy
On Tue, 26 Jun 2001, Stéphane JEAN BAPTISTE wrote: > What is chomp ? It removes a trailing newline from a string: chomp($line = ); This retrieves a line form an open filehandle and removes the trailing newline (\n) from the end. Actually, it chomps off whatever $/ is set to, but it is usually

Re: chomp ?

2001-06-26 Thread Aaron Craig
At 16:34 26.06.2001 +0200, Stéphane JEAN BAPTISTE wrote: >What is chomp ? > >tks It chops off the new line/return character when reading in a file. It's kind of magical, in that in changes the character it looks for depending on the system its run on. Aaron Craig Programming iSoftitler.com

Re: chomp ?

2001-06-26 Thread Maxim Berlin
Hello Stéphane, Tuesday, June 26, 2001, Stéphane JEAN BAPTISTE <[EMAIL PROTECTED]> wrote: SJB> What is chomp ? see output of perldoc -f chomp Best wishes, Maximmailto:[EMAIL PROTECTED]

RE: chomp ?

2001-06-26 Thread Ronald J. Yacketta
OUCH! some people just need a gentle slap to get them going.. kind of like a newborn ;) slap them on the arse to get them breathing. This was overkill ;) more like a boot to the skull! take it easy bubba :) > I'm usually the last person to say this (in fact I think it is > the first time I've

Re: chomp ?

2001-06-26 Thread Chas Owens
\n is not the same as newline. Newline is (in ascii) character 0x0A. \n is the end of line sequence for the target OS (LF on UNIX, CRLF on Win32, CR on Mac, "END_OF_LINE" on some mythical OS, etc.). This has bitten me in the past when I wrote code on a Linux box (\n = LF) and gave it someone on

RE: chomp ?

2001-06-26 Thread Paul
--- "Ronald J. Yacketta" <[EMAIL PROTECTED]> wrote: > OUCH! > > some people just need a gentle slap to get them going.. kind of like > a newborn ;) slap them on the arse to get them breathing. > > This was overkill ;) more like a boot to the skull! > take it easy bubba :) And after all the goo

Re: chomp ?

2001-06-26 Thread Kevin Meltzer
I think this is a very contradictory answer.. since if we were to RTFF (last F for FAQ) we would know not to answer in this way. It is not useful. The person asking the question should look at section 2.7 of the FAQ. The person giving this answer should look at 2.6. Both should look at section 4.

Re: chomp ?

2001-06-26 Thread Aaron Craig
At 11:03 26.06.2001 -0400, Kevin Meltzer wrote: >I think this is a very contradictory answer.. since if we were to RTFF >(last F for FAQ) we would know not to answer in this way. It is not >useful. Which FAQ? (seriously) :) Aaron Craig Programming iSoftitler.com

RE: chomp ?

2001-06-26 Thread John Edwards
http://learn.perl.org/beginners-faq I just went there and read it for the first time too ;) -Original Message- From: Aaron Craig [mailto:[EMAIL PROTECTED]] Sent: 26 June 2001 16:07 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: chomp ? At 11:03 26.06.2001 -0400, Kevin

Re: chomp ?

2001-06-26 Thread Kevin Meltzer
On Tue, Jun 26, 2001 at 05:07:22PM +0200, Aaron Craig ([EMAIL PROTECTED]) spew-ed forth: > At 11:03 26.06.2001 -0400, Kevin Meltzer wrote: > >I think this is a very contradictory answer.. since if we were to RTFF > >(last F for FAQ) we would know not to answer in this way. It is not > >useful. >

Re: chomp ?

2001-06-26 Thread Brett W. McCoy
On Tue, 26 Jun 2001, Aaron Craig wrote: > At 11:03 26.06.2001 -0400, Kevin Meltzer wrote: > >I think this is a very contradictory answer.. since if we were to RTFF > >(last F for FAQ) we would know not to answer in this way. It is not > >useful. > > Which FAQ? (seriously) :) The F-ing one! The

RE: chomp ?

2001-06-26 Thread John Edwards
04 To: Chris Hedemark Cc: [EMAIL PROTECTED] Subject: Re: chomp ? I think this is a very contradictory answer.. since if we were to RTFF (last F for FAQ) we would know not to answer in this way. It is not useful. The person asking the question should look at section 2.7 of the FAQ. The person giving

Re: chomp ?

2001-06-26 Thread Brent Michalski
Ok, this is not an RTFM post! The easiest way to find out what a particular command does is with the perldoc program. On the system that has Perl installed, please type the following: perldoc -f chomp You will get the documentation for this function! Easy huh?!!! Give that a read, then if y

Re: chomp ?

2001-06-26 Thread Chris Hedemark
would have given my more typical answer. Chris Hedemark - Hillsborough, NC http://yonderway.com - Original Message - From: "Ronald J. Yacketta" <[EMAIL PROTECTED]> To: "Chris Hedemark" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, June 26, 20

RE: chomp

2001-12-19 Thread Crowder, Rod
No, chomp removes any "\n" at the end of a string. see perldoc -f chomp Rod -Original Message- From: Purshottam Chandak [mailto:[EMAIL PROTECTED]] Sent: 19 December 2001 08:05 To: [EMAIL PROTECTED] Subject: chomp If I type, $date = 19990417; chomp $date; - will every variable c

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 character "\". You

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 passed in). The defau

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 removes whatever is in the $/ variable from the

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 chomp () >>> builtin function in perl. >> snip >> >>

Re: chomp () function

2010-08-29 Thread Kaushal Shriyan
On Sun, Aug 29, 2010 at 7:06 PM, Chas. Owens wrote: > 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

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
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 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 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() but it doesn't

Re: Chomp help...

2010-11-08 Thread Sheppy R
You could try doing this with a regex: $html_content =~ s/\n//g; This would look for any new-line ("\n") and replace it with nothing. The g at the end tells it to do this globally, so all instances of \n would be removed. On Mon, Nov 8, 2010 at 4:04 PM, Bobby wrote: > Hi, > > I'm having issue

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-09 Thread Chandrashekar Bhat
y > 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 look for any new-line ("\n") and replace it with nothing. The g > at > the e

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 > a string. Will > chom

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 feed at the > end. If

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 string has a space will

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-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 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 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

Re: Chomp method

2006-04-27 Thread Randal L. Schwartz
> ""Mr" == "Mr Shawn H Corey" <[EMAIL PROTECTED]> writes: "Mr> 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. "Mr> A good way to learn how a function works is to write a small program to "Mr> test it. There

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 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 document spends on the arcane de

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] > > However, you didn't challenge my point. You merely made a different > point. > It is *not* sufficient to merely experiment. Reading the reference doc is > mandatory for complete understanding. That's because 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 patch to the .p

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 > improvements by means of the p

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 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

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: 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 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 & list

2001-08-20 Thread Maxim Berlin
Hello Jennifer, Tuesday, August 21, 2001, Jennifer Pan <[EMAIL PROTECTED]> wrote: JP> I have a file : JP> #myfile.txt JP> a b c d JP> a c s g JP> g o y g JP> _END_ JP> I wrote a perl script to put each line into a list; JP> #/usr/bin/perl -

Re: chomp question

2001-09-14 Thread Brett W. McCoy
On Fri, 14 Sep 2001, siren jones wrote: > What is happening here? > > $date = `/bin/date + %y%m%d`; > print "$date"; > > prints > >20010914 > > > > But if I add: > > $a = chomp($date); > print "$a"; > > > it prints > > Because you aren't using chomp the way it's supposed to be used. Try this:

Re: chomp question

2001-09-14 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 14, siren jones said: >$date = `/bin/date + %y%m%d`; There's really no need to be calling an external system command to get the date. Perl has its own function, localtime(), and you can use the POSIX::strftime() function to use date-like formatting instructions (the %y and %m stuff). >$

Re: chomp operator

2007-10-30 Thread Rob Coops
Hi Kaushal, Yes you are right if you have a hardcoded line of text in your script you know if there is a "\n" or not at the end. Now imagine you are reading a bunch of data from a text file created from user input or some unknown script... who knows how much weird things are there at the end of t

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: [EMAIL PROTECTED] For addi

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 file will have a newline at the

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 \

no chop chop - Re: chomp-ing DOS lines, shifting, and a variable variable

2002-06-08 Thread drieux
On Saturday, June 8, 2002, at 04:47 , David T-G wrote: [..] > > The files were written in DOS format (\r\n or, I am more inclined to > think, \n\r) and chomp doesn't work; instead I have to > > ... > while (<>) > { > ... > chop ; chop ; # strip \n\r (no c

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

2002-06-08 Thread David T-G
Hi, all -- ...and then David T-G said... % ... % I can't modify $fullpath because I'll use it later, but for parsing I % don't need the leading "/mp3/" part, and the only way I've found to get % rid of it elegantly is % % ... % @working = split(/\//,$fullpath) ;# cut path

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

2002-06-09 Thread Elias Assmann
On Sat, 8 Jun 2002, David T-G wrote: > % I can't modify $fullpath because I'll use it later, but for parsing I > % don't need the leading "/mp3/" part, and the only way I've found to get > % rid of it elegantly is > % > % ... > % @working = split(/\//,$fullpath) ; # cut path in

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

2002-06-09 Thread Elias Assmann
On Sun, 9 Jun 2002, Elias Assmann wrote: > be two lines, so how about this: @working = m'/mp3(/[^/]+)+';? So much for posting code without trying it... This isn't working, but it isn't obvious to me why, and I don't have time right now :-( Elias -- Gefängnis für Hans Mustermann wegen

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

2002-06-09 Thread Elias Assmann
Oh my, what a bad day for my poor little brain... Sorry for all that confusion. On Sun, 9 Jun 2002, David T-G wrote: > Elias, et al -- > > ...and then Elias Assmann said... > > % be two lines, so how about this: @working = m'/mp3(/[^/]+)+';? It seems I have suffered a misconception about what

Re: no chop chop - Re: chomp-ing DOS lines, shifting, and a variable variable

2002-06-08 Thread David T-G
drieux, et al -- ...and then drieux said... % % On Saturday, June 8, 2002, at 04:47 , David T-G wrote: % [..] % > ... % >... % >chop ; chop ;# strip \n\r (no chomp here) ... % % that is way too weird - since that means that what % ever dos app you were using

Re: no chop chop - Re: chomp-ing DOS lines, shifting, and a variable variable

2002-06-09 Thread drieux
On Saturday, June 8, 2002, at 08:13 , David T-G wrote: > drieux, et al -- > ...and then drieux said... > % On Saturday, June 8, 2002, at 04:47 , David T-G wrote: [..] > % >... > % >chop ; chop ; # strip \n\r (no chomp here) > ... > % > % that is way too weird - si

Re: no chop chop - Re: chomp-ing DOS lines, shifting, and a variable variable

2002-06-09 Thread David T-G
drieux, et al -- ...and then drieux said... % % On Saturday, June 8, 2002, at 08:13 , David T-G wrote: % >drieux, et al -- % >...and then drieux said... % >% On Saturday, June 8, 2002, at 04:47 , David T-G wrote: ... % > % >Tell me about the standard... Should perl happily chomp either a UNIX o

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

2002-06-09 Thread David T-G
Elias -- ...and then Elias Assmann said... % % On Sun, 9 Jun 2002, Elias Assmann wrote: % % > be two lines, so how about this: @working = m'/mp3(/[^/]+)+';? % % So much for posting code without trying it... This isn't working, but *grin* % it isn't obvious to me why, and I don't have time r

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

2002-06-09 Thread David T-G
Elias, et al -- ...and then Elias Assmann said... % % On Sat, 8 Jun 2002, David T-G wrote: % % > % I can't modify $fullpath because I'll use it later, but for parsing I % > % don't need the leading "/mp3/" part, and the only way I've found to get ... % > While it may not be a perfect solution,

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

2002-06-09 Thread David T-G
Elias, et al -- ...and then Elias Assmann said... % % Oh my, what a bad day for my poor little brain... Sorry for all that % confusion. *grin* No problem; it made me check my answers :-) % % On Sun, 9 Jun 2002, David T-G wrote: % % > ...and then Elias Assmann said... % > % > % be two lines

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

2002-06-09 Thread Timothy Johnson
Elias Assmann Subject: Re: shifting solved (was "Re: chomp-ing DOS lines, shifting, and a variable variable") Elias, et al -- and then Elias Assmann said... % % Oh my, what a bad day for my poor little brain... Sorry for all that % confusion. *grin* No problem; it made me c

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

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 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 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
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... % % 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