Re: Trouble using shift

2005-01-02 Thread Jenda Krynicky
From: Oisin Peavoy <[EMAIL PROTECTED]> > I have a Perl program which I'm having some difficulty with, > essentially I'm > trying to `shift()' all the ellements in an array untill an element > containing a forward slash is encountered. Howerver, the method I'm > using is producing incorrect results

Re: Trouble using shift

2004-12-31 Thread Alfred Vahau
Translated thus: #!/usr/bin/perl -w use strict; my @array = qw(fairy goblin /emerald dust dice); shift @array while @array && $array[0] !~ m!/!; print "@array"; Confirmed that it works in Perl on WinXP. However, the solution seems a bit elegant for a beginner. Even the condition: if(/(^\/)/){ ..

Re: Trouble using shift

2004-12-31 Thread Paul Johnson
On Fri, Dec 31, 2004 at 03:25:53PM +, Oisin Peavoy wrote: > Hi, > > I have a Perl program which I'm having some difficulty with, > essentially I'm trying to `shift()' all the ellements in an array > untill an element containing a forward slash is encountered. Howerver, > the method I'm using i

Trouble using shift

2004-12-31 Thread Oisin Peavoy
Hi, I have a Perl program which I'm having some difficulty with, essentially I'm trying to `shift()' all the ellements in an array untill an element containing a forward slash is encountered. Howerver, the method I'm using is producing incorrect results. If the forward slash is placed infront of