[29678] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 922 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 10 14:09:42 2007

Date: Wed, 10 Oct 2007 11:09:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 10 Oct 2007     Volume: 11 Number: 922

Today's topics:
        Cantankerous trolliness ad infinitum, was: Re: The Mode <mkb@incubus.de>
        Does Perl micro-optimize? <rihad@mail.ru>
    Re: Does Perl micro-optimize? <ben@morrow.me.uk>
    Re: Does Perl micro-optimize? <wahab@chemie.uni-halle.de>
    Re: Does Perl micro-optimize? xhoster@gmail.com
    Re: Extended regexes - "(?<...)" construct. <Cloink_Friggson@ntlworld.com>
    Re: FAQ 5.17 How can I open a file with a leading ">" o <brian.d.foy@gmail.com>
        file uploader script <barn104_1999@yahoo.com>
    Re: file uploader script <noreply@gunnar.cc>
    Re: join("") somehow changes characters after 'z' <Cloink_Friggson@ntlworld.com>
    Re: join("") somehow changes characters after 'z' <simon.chao@fmr.com>
    Re: more elegant way to say ($1, $2, $3, $4, ...)? <szrRE@szromanMO.comVE>
        new CPAN modules on Wed Oct 10 2007 (Randal Schwartz)
    Re: pasting done twice <zen13097@zen.co.uk>
        Questions about Debugging <bol@adv.magwien.gv.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 10 Oct 2007 10:11:15 +0200
From: Matthias Buelow <mkb@incubus.de>
Subject: Cantankerous trolliness ad infinitum, was: Re: The Modernization of Emacs: terminology buffer and keybinding
Message-Id: <5n3fp4Ffvt8mU1@mid.dfncis.de>

nebulous99@gmail.com wrote:
^^^^^^^^^^^^^^^^^^^^^

Is this some sport of yours to constantly create new gmail accounts and
spam Usenet?

> So you assert, but "man" bears a much closer resemblance to "manus"
> than it does to "mens".

This is irrelevant. Consult an etymological dictionary.


F'up-to: comp.lang.lisp, where I'm reading this.


------------------------------

Date: Wed, 10 Oct 2007 10:23:01 -0700
From:  rihad <rihad@mail.ru>
Subject: Does Perl micro-optimize?
Message-Id: <1192036981.668531.178460@d55g2000hsg.googlegroups.com>

Hello there,

Say we have a $hash:

if ($hash{'A-String-Of-Any-Length'} eq 'foo') { ... }
else if ($hash{'A-String-Of-Any-Length'} eq 'bar') { ... }

Would Perl notice that hash lookup needs to be resolved only once, and
optimize further accesses? Or does one need to explicitly use a $tmp
for that?

Thanks.



------------------------------

Date: Wed, 10 Oct 2007 18:41:09 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Does Perl micro-optimize?
Message-Id: <lefvt4-0b6.ln1@osiris.mauzo.dyndns.org>


Quoth rihad <rihad@mail.ru>:
> Hello there,
> 
> Say we have a $hash:
> 
> if ($hash{'A-String-Of-Any-Length'} eq 'foo') { ... }
> else if ($hash{'A-String-Of-Any-Length'} eq 'bar') { ... }
> 
> Would Perl notice that hash lookup needs to be resolved only once, and
> optimize further accesses?

Nope.

> Or does one need to explicitly use a $tmp for that?

Yup. Note that under some circumstances

    my $tmp = $hash{foo};

can be slower than redoing the lookup, notably if $hash{foo} contains a
long string that must be copied. This can be got around with refs, but
that's messy. As ever, profile before you start thinking about
optimizing.

Note also that perl couldn't possibly perform this optimization, as it
would break tied hashes, or, at any rate, make the semantics highly
unreliable.

Ben



------------------------------

Date: Wed, 10 Oct 2007 19:38:36 +0200
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: Does Perl micro-optimize?
Message-Id: <fej39k$18d3$1@nserver.hrz.tu-freiberg.de>

rihad wrote:
> Hello there,
> 
> Say we have a $hash:
> 
> if ($hash{'A-String-Of-Any-Length'} eq 'foo') { ... }
> else if ($hash{'A-String-Of-Any-Length'} eq 'bar') { ... }
> 
> Would Perl notice that hash lookup needs to be resolved only once, and
> optimize further accesses? Or does one need to explicitly use a $tmp
> for that?

Perl5 does not, you can check that out for yourself
by the following snippet:

    my %hash = ('A_String_Of_Any_Length', 'FUD', map +(rand,rand),1..1000 );

1: if( $hash{A_String_Of_Any_Length} eq 'foo') {
      print "do a lot of thinngs\n"
    }
2: elsif( $hash{A_String_Of_Any_Length} eq 'bar') {
      print "do not so simple things\n"
    }
    else {
     print "do nothing\n"
    }


if viewed by perl -MO=Bblock rihad.pl,
it shows both hash lookups:
      ...
      OP (0x1838050) padhv [1]
1:   SVOP (0x1838030) const [14] PV (0x1969814) "A_String_Of_Any_Length"
      BINOP (0x183800c) helem
      SVOP (0x1837fec) const [15] PV (0x196982c) "foo"
      BINOP (0x1837fc8) seq

      LOGOP (0x1837b40) cond_expr
      OP (0x1837f08) pushmark
      SVOP (0x1837f48) const [16] PV (0x1969820) "do a lot of thinngs\n"
      LISTOP (0x1837f24) print

      OP (0x1837e8c) padhv [1]
2:   SVOP (0x1837e6c) const [17] PV (0x1969838) "A_String_Of_Any_Length"
      BINOP (0x1837e48) helem
      SVOP (0x1837e28) const [18] PV (0x1969850) "bar"
      BINOP (0x1837e04) seq

      LOGOP (0x1837b84) cond_expr
      ...

Regards

M.


------------------------------

Date: 10 Oct 2007 17:57:33 GMT
From: xhoster@gmail.com
Subject: Re: Does Perl micro-optimize?
Message-Id: <20071010135735.494$Uy@newsreader.com>

rihad <rihad@mail.ru> wrote:
> Hello there,
>
> Say we have a $hash:
>
> if ($hash{'A-String-Of-Any-Length'} eq 'foo') { ... }
> else if ($hash{'A-String-Of-Any-Length'} eq 'bar') { ... }

Perl doesn't have an "else if".  It has "elsif"

> Would Perl notice that hash lookup needs to be resolved only once, and
> optimize further accesses?

I don't think so, but if it did do this kind of thing ever, it would
probably vary a lot from situation to situation and version to version.
And imagine the chaos this could cause for tied hashes.

If the look-up string were in a variable, I know that in some situations
and with some versions, the hashed integer of the (potentially very large)
string can be stored in the SV rather than needing to be recomputed.  I
don't know what happens with literals.

> Or does one need to explicitly use a $tmp
> for that?

If one wants the lookup not to be done twice, then you would need to use
a temp variable.  It seems that this is at least as likely to make things
slower as faster, though.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


------------------------------

Date: Wed, 10 Oct 2007 08:39:44 -0700
From:  Cloink <Cloink_Friggson@ntlworld.com>
Subject: Re: Extended regexes - "(?<...)" construct.
Message-Id: <1192030784.405577.20780@g4g2000hsf.googlegroups.com>

Thanks for all your help.

Whilst I generally DO recommend O'Reilly books, not only is their Perl
in a Nutshell book badly written, it now appears it is quite crucially
wrong too.

I will try and remember "perldoc perlre", but I don't use Perl day in
day out, so I am likely to forget.

Thanks again.



------------------------------

Date: Wed, 10 Oct 2007 09:54:31 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 5.17 How can I open a file with a leading ">" or trailing blanks?
Message-Id: <101020070954313936%brian.d.foy@gmail.com>

In article <QpKdnfWoYNgkr5banZ2dnUVZ_gadnZ2d@comcast.com>, Joe Smith
<joe@inwap.com> wrote:

> PerlFAQ Server wrote:
> 
> > 5.17: How can I open a file with a leading ">" or trailing blanks?
> > 
> >     Unless you have a particular reason to use the two argument form ...
> 
> It's probably worth mentioning one good reason for using the two
> argument form, and that is if your program is documented to accept
> a filename of "-" to read from STDIN.

That getsw away from the topic of the question, so it's a bit
distracting. The weasel words "Unless you have a particular reason"
really says "you have to find out on your own because we're not going
to encourage it". :)


------------------------------

Date: Wed, 10 Oct 2007 07:44:22 -0700
From:  ll <barn104_1999@yahoo.com>
Subject: file uploader script
Message-Id: <1192027462.667664.6210@r29g2000hsg.googlegroups.com>

I'm working with an uploader script and am trying to establish the
parent directory to which files will be uploaded.  However, after the
parent directory is set in the code and the file is uploaded, a folder
is created 'under' the cgi-bin folder that has the full path name as
its title, rather than using that path as the basis upon which to
concatenate the rest of the path.  The page, when run, says that the
file has been uploaded successfully, but when following the link it
generates to the file, it cannot be opened, due to a repeat in the
path (e.g. www.mysite.com/uploads/uploads/test.txt)

Here is the URL for the download for this: http://www.cnctek.com/bizdb-html/download.html

Follow this link:
Download File Uploader - use "guest" for user name and password

Thanks for any help or resources,
Louis



------------------------------

Date: Wed, 10 Oct 2007 17:07:56 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: file uploader script
Message-Id: <5n486lFg055mU1@mid.individual.net>

ll wrote:
> I'm working with an uploader script and am trying to establish the
> parent directory to which files will be uploaded.  However, after the
> parent directory is set in the code and the file is uploaded, a folder
> is created 'under' the cgi-bin folder that has the full path name as
> its title, rather than using that path as the basis upon which to
> concatenate the rest of the path.  The page, when run, says that the
> file has been uploaded successfully, but when following the link it
> generates to the file, it cannot be opened, due to a repeat in the
> path (e.g. www.mysite.com/uploads/uploads/test.txt)
> 
> Here is the URL for the download for this: http://www.cnctek.com/bizdb-html/download.html
> 
> Follow this link:
> Download File Uploader - use "guest" for user name and password

If that script doesn't work as expected, please consult the 
documentation or the script author.

If you want to write your own script, and are encountering difficulties 
when doing so, this group may be a good place to ask for help. Btw, you 
may want to make use of the CPAN module CGI::UploadEasy.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 10 Oct 2007 10:48:03 -0700
From:  Cloink <Cloink_Friggson@ntlworld.com>
Subject: Re: join("") somehow changes characters after 'z'
Message-Id: <1192038483.388876.263430@r29g2000hsg.googlegroups.com>

Could someone explain in even more layman terms (I struggle with
Perl), whether this will help me with a similar encoding problem I
have?

Please note that thhe URI::Escape::uri_unescape() function does not
cater for the latter encodings.

I receive from a JavaScript-encoded URL in a web/cgi environment,
potentially UTF8 data encoded via encodeURIComponent(); for example a
=A3-sign (GBP-pound-sign, in case that got mis-translated) is charCode
163 and becomes %C2%A3. You can do this in your web browser by typing
this in your address bar:-
    javascript:alert(encodeURIComponent('=A3'))
(if you have =A3-sign on your keyboard! the not-sign, =AC, and broken
pipe, =A6, chars do it too).

I have managed to get compatability between JS & Perl, up to 255
(possibly higher, don't have the code in front of me here - certainly,
I've got a =A3-sign working); however, I know that the compatability
will break for the higher-order characters that will be encoded in JS
to a series of THREE %xx's, eg %11%A2%4D (no idea what that might be).

Many thanks.



------------------------------

Date: Wed, 10 Oct 2007 18:06:52 -0000
From:  it_says_BALLS_on_your forehead <simon.chao@fmr.com>
Subject: Re: join("") somehow changes characters after 'z'
Message-Id: <1192039612.553940.68720@v3g2000hsg.googlegroups.com>

On Oct 10, 1:48 pm, Cloink <Cloink_Frigg...@ntlworld.com> wrote:
> Could someone explain in even more layman terms (I struggle with
> Perl), whether this will help me with a similar encoding problem I
> have?
>
> Please note that thhe URI::Escape::uri_unescape() function does not
> cater for the latter encodings.
>
> I receive from a JavaScript-encoded URL in a web/cgi environment,
> potentially UTF8 data encoded via encodeURIComponent(); for example a
> =A3-sign (GBP-pound-sign, in case that got mis-translated) is charCode
> 163 and becomes %C2%A3. You can do this in your web browser by typing
> this in your address bar:-
>     javascript:alert(encodeURIComponent('=A3'))
> (if you have =A3-sign on your keyboard! the not-sign, =AC, and broken
> pipe, =A6, chars do it too).
>
> I have managed to get compatability between JS & Perl, up to 255
> (possibly higher, don't have the code in front of me here - certainly,
> I've got a =A3-sign working); however, I know that the compatability
> will break for the higher-order characters that will be encoded in JS
> to a series of THREE %xx's, eg %11%A2%4D (no idea what that might be).
>

Have you examined HTML::Entities::encode_entities? This may do what
you require--not positive.



------------------------------

Date: Tue, 9 Oct 2007 23:37:11 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: more elegant way to say ($1, $2, $3, $4, ...)?
Message-Id: <fehrva01nsb@news2.newsguy.com>

Larry wrote:
> I'm using a /g regex in a while loop to capture parenthesized matches
> to meaningful variable names like this:
>
> while (/ (...) ... (...) ... (...)/g) {
>    my ($foo, $bar, $baz) = ($1, $2, $3);
>    ...
> }
>
> The ($1, $2, $3) part seems inelegant ... is there a more elegant way?
>
> BTW, don't suggest:
>
> while (my ($foo, $bar, $baz) = / (...) ... (...) ... (...)/g) {
>    ...
> }
>
> That will cause the regex to evaluate in a list context, which changes
> the behavior of /g to parse all of $_ at once, only returning the
> first match and throwing away the rest.

Why not just do something like the following?

   my $s = 'A1Z B2Y C3X D4W E5V';

   ### Inelegant - have to know amount of captures/loop-iteration
   while ($s =~ /(\w)(\d)(\w)/g) {
      my ($foo, $bar, $baz) = ($1, $2, $3);
      print "'$foo' '$bar' '$baz'\n";
   }

   print "\n";

   ### More elegant - all matches for each iteration goes into an array
   while (my @matches = $s =~ /\G.*?(\w)(\d)(\w)/) {
      pos($s) = $+[0];
      print "'", join("' '", @matches), "'\n";
   }

   ___OUTPUT___
   'A' '1' 'Z'
   'B' '2' 'Y'
   'C' '3' 'X'
   'D' '4' 'W'
   'E' '5' 'V'

   'A' '1' 'Z'
   'B' '2' 'Y'
   'C' '3' 'X'
   'D' '4' 'W'
   'E' '5' 'V'


All you have to do is add   \G.*?   to the beginning of the regex, and 
remove   g   from the end of the regex (modifier list.) Other than that, 
you just need to have   pos($s) = $+[0];   at the beginning of your loop 
(or at least before the end of the loop, thouhg it seems safest to keep 
it at the beginning, especially if you do any tests on pos($s)

:-)


-- 
szr 




------------------------------

Date: Wed, 10 Oct 2007 04:42:16 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Oct 10 2007
Message-Id: <JpoIEG.ot@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Alien-CodePress-1.01
http://search.cpan.org/~asksh/Alien-CodePress-1.01/
Installing and finding CodePress. 
----
Alter-0.07
http://search.cpan.org/~anno/Alter-0.07/
Alter Ego Objects 
----
Crypt-Elijah-0.07
http://search.cpan.org/~bomb/Crypt-Elijah-0.07/
cipher module 
----
DBICx-Deploy-0.01
http://search.cpan.org/~jrockway/DBICx-Deploy-0.01/
deploy a DBIx::Class schema 
----
DBICx-Deploy-0.02
http://search.cpan.org/~jrockway/DBICx-Deploy-0.02/
deploy a DBIx::Class schema 
----
DBIx-InterpolationBinding-0.03
http://search.cpan.org/~lukeross/DBIx-InterpolationBinding-0.03/
Perl extension for turning perl double-quote string interpolation into DBI bind parameters. 
----
DBIx-InterpolationBinding-0.04
http://search.cpan.org/~lukeross/DBIx-InterpolationBinding-0.04/
Perl extension for turning perl double-quote string interpolation into DBI bind parameters. 
----
DBIx-Perlish-0.29
http://search.cpan.org/~gruber/DBIx-Perlish-0.29/
a perlish interface to SQL databases 
----
DBIx-StORM-0.04
http://search.cpan.org/~lukeross/DBIx-StORM-0.04/
Perl extension for object-relational mapping 
----
DBIx-VersionedSchema-0.03
http://search.cpan.org/~bosu/DBIx-VersionedSchema-0.03/
helps to manage database schema versions 
----
Data-Throttler-Memcached-0.00002
http://search.cpan.org/~dmaki/Data-Throttler-Memcached-0.00002/
Memcached-Based Data::Throttler 
----
Email-Outlook-Message-0.901
http://search.cpan.org/~mvz/Email-Outlook-Message-0.901/
Read Outlook .msg files 
----
Exception-Base-0.10
http://search.cpan.org/~dexter/Exception-Base-0.10/
Lightweight exceptions 
----
Exception-System-0.0701
http://search.cpan.org/~dexter/Exception-System-0.0701/
The exception class for system or library calls 
----
FFmpeg-Command-0.07
http://search.cpan.org/~mizzy/FFmpeg-Command-0.07/
A wrapper class for ffmpeg command line utility. 
----
HTML-Table-2.07-b2
http://search.cpan.org/~ajpeacock/HTML-Table-2.07-b2/
produces HTML tables 
----
IO-Socket-SSL-1.10
http://search.cpan.org/~sullr/IO-Socket-SSL-1.10/
Nearly transparent SSL encapsulation for IO::Socket::INET. 
----
IPC-PubSub-0.27
http://search.cpan.org/~audreyt/IPC-PubSub-0.27/
Interprocess Publish/Subscribe channels 
----
Image-Imager-Thumbnail-0.01
http://search.cpan.org/~ebruni/Image-Imager-Thumbnail-0.01/
Produces thumbnail images with Imager 
----
InSilicoSpectro-1.3.1
http://search.cpan.org/~alexmass/InSilicoSpectro-1.3.1/
Open source Perl library for proteomics 
----
JSON-Any-1.09
http://search.cpan.org/~perigrin/JSON-Any-1.09/
Wrapper Class for the various JSON classes. 
----
LWP-UserAgent-WithCache-0.04
http://search.cpan.org/~sekimura/LWP-UserAgent-WithCache-0.04/
LWP::UserAgent extension with local cache 
----
LWP-UserAgent-WithCache-0.05
http://search.cpan.org/~sekimura/LWP-UserAgent-WithCache-0.05/
LWP::UserAgent extension with local cache 
----
LWP-UserAgent-WithCache-0.06
http://search.cpan.org/~sekimura/LWP-UserAgent-WithCache-0.06/
LWP::UserAgent extension with local cache 
----
Linux-Smaps-0.05
http://search.cpan.org/~opi/Linux-Smaps-0.05/
a Perl interface to /proc/PID/smaps 
----
NBU-0.92
http://search.cpan.org/~dutchman/NBU-0.92/
Main entry point for NetBackup OO Modules 
----
POE-Component-Client-Stomp-0.03
http://search.cpan.org/~kesteb/POE-Component-Client-Stomp-0.03/
Perl extension for the POE Environment 
----
POE-Component-SNMP-Session-0.07
http://search.cpan.org/~rdb/POE-Component-SNMP-Session-0.07/
Wrap Net-SNMP's SNMP::Session in POE 
----
PPI-1.199_05
http://search.cpan.org/~adamk/PPI-1.199_05/
Parse, Analyze and Manipulate Perl (without perl) 
----
Parse-Marpa-0.1_12
http://search.cpan.org/~jkegl/Parse-Marpa-0.1_12/
Earley's Algorithm, with improvements 
----
Perl-Critic-1.079_001
http://search.cpan.org/~elliotjs/Perl-Critic-1.079_001/
Critique Perl source code for best-practices 
----
QWizard-3.09
http://search.cpan.org/~hardaker/QWizard-3.09/
Display a series of questions, get the answers, and act on the answers. 
----
QWizard-3.10
http://search.cpan.org/~hardaker/QWizard-3.10/
Display a series of questions, get the answers, and act on the answers. 
----
RT-OnlineDocs-0.08
http://search.cpan.org/~falcone/RT-OnlineDocs-0.08/
----
SVG-Convert-0.02
http://search.cpan.org/~zigorou/SVG-Convert-0.02/
The fantastic new SVG::Convert! 
----
SVG-Convert-Driver-XAML-0.02
http://search.cpan.org/~zigorou/SVG-Convert-Driver-XAML-0.02/
SVG::Convert XAML driver. 
----
Socialtext-Resting-0.22
http://search.cpan.org/~lukec/Socialtext-Resting-0.22/
module for accessing Socialtext REST APIs 
----
Socialtext-Resting-Utils-0.17
http://search.cpan.org/~lukec/Socialtext-Resting-Utils-0.17/
Utilities for Socialtext REST APIs 
----
Test-Reporter-1.38
http://search.cpan.org/~fhoxh/Test-Reporter-1.38/
sends test results to cpan-testers@perl.org 
----
Test-TempDatabase-0.11
http://search.cpan.org/~bosu/Test-TempDatabase-0.11/
temporary database creation and destruction. 
----
Tk-ObjScanner-2.012
http://search.cpan.org/~ddumont/Tk-ObjScanner-2.012/
Tk data scanner 
----
Tk-RotatingGauge-0.23
http://search.cpan.org/~jquelin/Tk-RotatingGauge-0.23/
a rotating gauge for Tk 
----
WWW-Mechanize-FormFiller-0.08
http://search.cpan.org/~corion/WWW-Mechanize-FormFiller-0.08/
framework to automate HTML forms 
----
WWW-Mixi-Scraper-0.09
http://search.cpan.org/~ishigaki/WWW-Mixi-Scraper-0.09/
yet another mixi scraper 
----
Win32-GuiTest-1.54
http://search.cpan.org/~karasik/Win32-GuiTest-1.54/
Perl GUI Test Utilities. 
----
YATG-1.0301
http://search.cpan.org/~oliver/YATG-1.0301/
Fast SNMP data poller daemon, with storage and graphing 
----
kurila-1.3_0
http://search.cpan.org/~tty/kurila-1.3_0/


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: 10 Oct 2007 07:33:46 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: pasting done twice
Message-Id: <470c805a$0$21099$da0feed9@news.zen.co.uk>

On Tue, 09 Oct 2007 12:11:10 -0700, lerameur <lerameur@yahoo.com> wrote:
>
>          my @items =  (split(/,/,$line))[0..85];
>  		 $items[86]="696c6c65";
>  		my @items_extra =  (split(/,/,$line))[87..88]; #86 is user data
>  		print $out_file join(',', @items),",";

Here you print @items, which *includes* $items[86]

>  		print $out_file $items[86],",";

Here you print $items[86] for the second time.




------------------------------

Date: Wed, 10 Oct 2007 16:28:03 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Questions about Debugging
Message-Id: <1192026504.298597@proxy.dienste.wien.at>

Hi group,

I have 2 questions concerning Perl debugging:

o) When debugging code inside BEGIN blocks (including code
loaded with 'use'), one has to add

BEGIN {
  $DB::single = 1;
}

at the top of the main code.

Are there plans to provide a switch to run this code automatically
before debugging starts (so there isn't need to edit the main code
for this)? Do you think a switch like this would make sense?

o) Is there a way to debug code executed as part of a source filter
(created with Filter::Simple)?

Greetings, Ferry
-- 

Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: bol@adv.magwien.gv.at




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 922
**************************************


home help back first fref pref prev next nref lref last post