[Israel.pm] how do i cut the first 2 characters/digits of a string?

Gabor Szabo gabor at pti.co.il
Thu Jul 15 05:15:54 PDT 2004


On Thu, 15 Jul 2004, Gaal Yahas wrote:

> > >
> > >      chop($_ = reverse); $_ = reverse chop
> > >
> > > not do the same thing?
> >
> > Using the return value of chop ?
>
> Yup :)
>
> Simple enough to be a stumper, if you're not appropriately caffinated.

being a trainer I got used to seeing this code::

while (chomp ($line = <STDIN>)) {
    print "Why is this thing not working properly ?";
}

In all my beginner classes about 50% of the students do it at least once.

Then maybe the problem is with the trainer...

I think should not show them
   chomp($line = <STDIN>)

until the end of the course...
or maybe after it.

Gabor



More information about the Perl mailing list