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
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(/(^\/)/){ ..
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
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