[25629] in Perl-Users-Digest
Perl-Users Digest, Issue: 7871 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 9 18:11:02 2005
Date: Wed, 9 Mar 2005 15:10:45 -0800 (PST)
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, 9 Mar 2005 Volume: 10 Number: 7871
Today's topics:
multidimensional hash modified by test (Mike Solomon)
Re: multidimensional hash modified by test <1usa@llenroc.ude.invalid>
Re: multidimensional hash modified by test xhoster@gmail.com
Re: multidimensional hash modified by test <tadmc@augustmail.com>
Re: multidimensional hash modified by test <l.heisler@utoronto.ca>
Re: multidimensional hash modified by test <l.heisler@utoronto.ca>
Re: multidimensional hash modified by test <1usa@llenroc.ude.invalid>
Re: negative backreference? (Anno Siegel)
new IO::Socket::INET + UDP/Broadcast = Permission denie <snail@localhost.com>
One Liner to reverse sort file <don.hoggatt@pbsg.com>
Re: One Liner to reverse sort file (Walter Roberson)
Re: One Liner to reverse sort file xhoster@gmail.com
Re: One Liner to reverse sort file xhoster@gmail.com
Re: p5 manager for whole file backups <ThomasKratz@REMOVEwebCAPS.de>
Re: p5 manager for whole file backups <shawn.corey@sympatico.ca>
Perl code encryption <Mark.Fenbers@NOSPAMnoaa.gov>
Re: Perl code encryption <stampes@xilinx.com>
Re: Perl code encryption <Mark.Fenbers@NOSPAMnoaa.gov>
Re: Perl code encryption <minter@lunenburg.org>
Re: Perl code encryption <tadmc@augustmail.com>
Re: Perl code encryption <bastard@uni-koblenz.de>
perl-Cvs woes <noeldamonmiller@gmail.com>
Re: perl-Cvs woes <tadmc@augustmail.com>
Re: perl-Cvs woes <noeldamonmiller@gmail.com>
Re: perlce (perl and perlide) <jfrijdel@hotmail.com>
Re: perlce (perl and perlide) <jfrijdel@hotmail.com>
Re: perlpod/perldoc Q: I want asterisk bullets <skuo@mtwhitney.nsc.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Mar 2005 09:50:35 -0800
From: mike_solomon@lineone.net (Mike Solomon)
Subject: multidimensional hash modified by test
Message-Id: <56568be5.0503090950.13b1f2d6@posting.google.com>
I ran the following script and got what I consider to be a strange result
my %data;
$data{a}{a} = 1;
my $total = keys %data;
print "$total\n";
#prints 1
print "NOT IN HASH\n" unless $data{b}{b};
#prints NOT IN HASH
$total = keys %data;
print "$total\n";
#prints 2
Why does the total keys increase to 2 when I test for non existent data?
Thanks
------------------------------
Date: 9 Mar 2005 18:14:31 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: multidimensional hash modified by test
Message-Id: <Xns961486B46A5B6asu1cornelledu@132.236.56.8>
mike_solomon@lineone.net (Mike Solomon) wrote in
news:56568be5.0503090950.13b1f2d6@posting.google.com:
> I ran the following script and got what I consider to be a strange result
>
>
> my %data;
>
> $data{a}{a} = 1;
>
> my $total = keys %data;
>
> print "$total\n";
>
> #prints 1
>
> print "NOT IN HASH\n" unless $data{b}{b};
This autovivifies $data{b}.
...
> Why does the total keys increase to 2 when I test for non existent data?
You should use exists if you want to test for existence:
perldoc -f exists
Sinan
------------------------------
Date: 09 Mar 2005 18:57:03 GMT
From: xhoster@gmail.com
Subject: Re: multidimensional hash modified by test
Message-Id: <20050309135703.157$61@newsreader.com>
mike_solomon@lineone.net (Mike Solomon) wrote:
> I ran the following script and got what I consider to be a strange result
>
> my %data;
>
> $data{a}{a} = 1;
>
> my $total = keys %data;
>
> print "$total\n";
>
> #prints 1
>
> print "NOT IN HASH\n" unless $data{b}{b};
>
> #prints NOT IN HASH
> $total = keys %data;
>
> print "$total\n";
>
> #prints 2
>
> Why does the total keys increase to 2 when I test for non existent data?
It is called autovivification. You can read about it in perldoc perlref.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Wed, 9 Mar 2005 13:04:39 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: multidimensional hash modified by test
Message-Id: <slrnd2ui67.cms.tadmc@magna.augustmail.com>
Mike Solomon <mike_solomon@lineone.net> wrote:
> print "NOT IN HASH\n" unless $data{b}{b};
> $total = keys %data;
> print "$total\n";
> #prints 2
>
> Why does the total keys increase to 2 when I test for non existent data?
Autovivification.
See:
perldoc perlreftut
perldoc perlref
And Randal has written a column on that (of course):
http://www.stonehenge.com/merlyn/UnixReview/col44.html
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 9 Mar 2005 19:12:13 GMT
From: "LEH" <l.heisler@utoronto.ca>
Subject: Re: multidimensional hash modified by test
Message-Id: <ID3MJz.AL9@campus-news-reading.utoronto.ca>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns961486B46A5B6asu1cornelledu@132.236.56.8...
> mike_solomon@lineone.net (Mike Solomon) wrote in
> news:56568be5.0503090950.13b1f2d6@posting.google.com:
>
> > I ran the following script and got what I consider to be a strange
result
> >
> >
> > my %data;
> >
> > $data{a}{a} = 1;
> >
> > my $total = keys %data;
> >
> > print "$total\n";
> >
> > #prints 1
> >
> > print "NOT IN HASH\n" unless $data{b}{b};
>
> This autovivifies $data{b}.
>
> ...
>
> > Why does the total keys increase to 2 when I test for non existent data?
>
> You should use exists if you want to test for existence:
>
> perldoc -f exists
>
> Sinan
using exists,
ie. print "NOT IN HASH\n" unless exists $data{b}{b};
also seems to autovivify $data{b}
according to perldoc -f exists
if (exists &{$ref->{A}{B}{$key}}) { }
Although the deepest nested array or hash will not spring into
existence just because its existence was tested, any intervening
ones will. Thus "$ref->{"A"}" and "$ref->{"A"}->{"B"}" will
spring into existence due to the existence test for the $key
element above.
Larry
------------------------------
Date: Wed, 9 Mar 2005 19:34:57 GMT
From: "LEH" <l.heisler@utoronto.ca>
Subject: Re: multidimensional hash modified by test
Message-Id: <ID3nLu.BDH@campus-news-reading.utoronto.ca>
"LEH" <l.heisler@utoronto.ca> wrote in message
news:ID3MJz.AL9@campus-news-reading.utoronto.ca...
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns961486B46A5B6asu1cornelledu@132.236.56.8...
> > mike_solomon@lineone.net (Mike Solomon) wrote in
> > news:56568be5.0503090950.13b1f2d6@posting.google.com:
> >
> > > I ran the following script and got what I consider to be a strange
> result
> > >
> > >
> > > my %data;
> > >
> > > $data{a}{a} = 1;
> > >
> > > my $total = keys %data;
> > >
> > > print "$total\n";
> > >
> > > #prints 1
> > >
> > > print "NOT IN HASH\n" unless $data{b}{b};
> >
> > This autovivifies $data{b}.
> >
> > ...
> >
> > > Why does the total keys increase to 2 when I test for non existent
data?
> >
> > You should use exists if you want to test for existence:
> >
> > perldoc -f exists
> >
> > Sinan
>
> using exists,
> ie. print "NOT IN HASH\n" unless exists $data{b}{b};
> also seems to autovivify $data{b}
>
> according to perldoc -f exists
>
> if (exists &{$ref->{A}{B}{$key}}) { }
> Although the deepest nested array or hash will not spring into
> existence just because its existence was tested, any intervening
> ones will. Thus "$ref->{"A"}" and "$ref->{"A"}->{"B"}" will
> spring into existence due to the existence test for the $key
> element above.
>
> Larry
>
but this works
print "NOT IN HASH\n" unless exists $data{b} && $data{b}{b};
although perhaps there is a better way.
Larry
------------------------------
Date: Wed, 09 Mar 2005 22:31:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: multidimensional hash modified by test
Message-Id: <Xns9614B25B32119asu1cornelledu@127.0.0.1>
"LEH" <l.heisler@utoronto.ca> wrote in
news:ID3MJz.AL9@campus-news-reading.utoronto.ca:
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns961486B46A5B6asu1cornelledu@132.236.56.8...
>> mike_solomon@lineone.net (Mike Solomon) wrote in
>> news:56568be5.0503090950.13b1f2d6@posting.google.com:
>>
...
>> > print "NOT IN HASH\n" unless $data{b}{b};
>>
>> This autovivifies $data{b}.
>>
>> ...
>>
>> > Why does the total keys increase to 2 when I test for non existent
>> > data?
>>
>> You should use exists if you want to test for existence:
>>
>> perldoc -f exists
...
> according to perldoc -f exists
>
> if (exists &{$ref->{A}{B}{$key}}) { }
...
> ones will. Thus "$ref->{"A"}" and "$ref->{"A"}->{"B"}" will
> spring into existence due to the existence test for the $key
> element above.
Aaaah ... I don't know how I forgot that but thanks for catching the
error.
Sinan.
------------------------------
Date: 9 Mar 2005 20:18:59 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: negative backreference?
Message-Id: <d0nlnj$6c1$1@mamenchi.zrz.TU-Berlin.DE>
Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote in comp.lang.perl.misc:
> [A complimentary Cc of this posting was sent to
> Anno Siegel
> <anno4000@lublin.zrz.tu-berlin.de>], who wrote in article
> <d0c48i$39r$1@mamenchi.zrz.TU-Berlin.DE>:
> > > (mutatis mutandis). Having different match than \w+ will lead so more
> > > complicated stuff than \b... In perfect life, one would use something
> > > like my (proposed) onion rings:
> > >
> > > /rdns=(\S*) helo=(?& \S* & (?!\1)/;
>
> /rdns=(\S*) helo=(?& \S* & (?!\1))/
>
> maybe even
>
> /rdns=(\S*) helo=(?& \S* &! \1)/
>
> > Is that proposal available somewhere?
>
> I think so. google for it...
I tried. In the presence of a number of _State of the Onion_s the puns
overwhelmed me.
> > I'm not sure how "(?&" is supposed to work.
>
> A & B & C & D ...
>
> B should match a substring of what A matched, C should match a
> substring of what B matched etc... One can replace & by &! (negating
> the following group).
Ah... Now I'm getting the name too -- successive substrings.
> Actually, another, "anchored", flavor is useful
> in other situations: one where B should match *exactly* the string
> which A matched (and not a substring thereof). [example above uses
> the second flavor]
With infinitesimal onion rings...
> It was never clear to me how to distinguish these two flavors; maybe
> something as simple as && vs &...
Hard to remember which is which in a not-too-often-used construct.
How about =& ?
Anno
------------------------------
Date: Wed, 9 Mar 2005 13:20:08 -0800
From: "Snail" <snail@localhost.com>
Subject: new IO::Socket::INET + UDP/Broadcast = Permission denied ?? Why?
Message-Id: <d0np7p$krr$1@news.astound.net>
The Following code works fine on my Win32 based system (with the server
part running on the Linux system)...
##------------------------------------------------------------------------------
#!/usr/local/bin/perl -w
use strict;
use vars qw/$sock $msg/;
use IO::Socket;
my $app_mode = $ARGV[0] || '-c';
if (lc($app_mode) eq '-c') {
print "Entering Client mode...\n\n";
$sock = new IO::Socket::INET(
LocalHost => '0.0.0.0', # Manually set the client's origion
addr/port
LocalPort => '3051',
PeerAddr => '192.168.0.255',
PeerPort => '3050', # Port the udp server listens on
Proto => 'udp',
Broadcast => 1 # Not sure if this is needed, I know the sockopt is
) || die "[ERROR] $!\n";
$sock->sockopt(SO_BROADCAST, 1);
print $sock "test\n";
}
# [snipped rest]
# ('else' it acts as a server lisening on UDP port 3050.)
##------------------------------------------------------------------------------
But on my linux system (RH 7.3) I get "permission denied" from $! when I
try to create the socket. (Running the server part on the Win32 box,
though the lcient on the linux never gets passed the "new
IO::Socket::INET" statement.
$ ./udptest.pl -c
Entering Client mode...
[ERROR] Permission denied
And I tried logging in as root (su - root and even hitting alt+ctrl+F1
and lgging in as root from there.) Either way I get the same result.
Is there a simple way around this, without enabling something in the
kernel or so, as I want this program to send to an entire network and be
portable.
Thanks for any help.
------------------------------
Date: 9 Mar 2005 14:15:46 -0800
From: "hogg" <don.hoggatt@pbsg.com>
Subject: One Liner to reverse sort file
Message-Id: <1110406546.792601.164180@o13g2000cwo.googlegroups.com>
I was wondering if there was a one liner that would reverse order a
file w/o having to write the output to another file. I can reverse
order a file using: awk '{printf "%10d\t%s\n",NR,$0}' <FILE> | sort -nr
| cut -f2- >> <FILE2>, but this makes me create another file. I wanted
to be able to do it 'on the fly'.
Any suggestions?
------------------------------
Date: 9 Mar 2005 22:28:09 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: One Liner to reverse sort file
Message-Id: <d0nt9p$j4m$1@canopus.cc.umanitoba.ca>
In article <1110406546.792601.164180@o13g2000cwo.googlegroups.com>,
hogg <don.hoggatt@pbsg.com> wrote:
:I was wondering if there was a one liner that would reverse order a
:file w/o having to write the output to another file.
my @revsortedfile = sort { $b cmp $a } <FILE>;
--
"No one has the right to destroy another person's belief by
demanding empirical evidence." -- Ann Landers
------------------------------
Date: 09 Mar 2005 22:44:45 GMT
From: xhoster@gmail.com
Subject: Re: One Liner to reverse sort file
Message-Id: <20050309174445.646$lk@newsreader.com>
"hogg" <don.hoggatt@pbsg.com> wrote:
> I was wondering if there was a one liner that would reverse order a
> file w/o having to write the output to another file. I can reverse
> order a file using: awk '{printf "%10d\t%s\n",NR,$0}' <FILE> | sort -nr
> | cut -f2- >> <FILE2>,
No need for all of that, at least not on modern Linux:
tac FILE > FILE2
> but this makes me create another file. I wanted
> to be able to do it 'on the fly'.
It does not make you create another file, that is what you chose to
do. You could certainly pipe the output into just about anything you want,
rather than redirecting it to a file.
> Any suggestions?
You were so busy telling us what you didn't want to do, you failed to tell
us what you do want to do.
If you want the reversed data as input to perl, you can do:
open my $fh, "tac File |" or die $!;
while (<$fh>) {
#do whatever
}
close $fh or die $!;
If you want the reversed data written back to the same file, you could tie
the file to an array with Tie::File, and then just reverse the array. But
that would probably be ungodly slow. You could study Tie::File code and
then make your own module which does what you want quickly, and then invoke
that module with a one-liner. Come to think of it, you could just read the
file into an array, reverse the array, and print it back out, assuming the
whole file fit into memory. Leaving perl and going back to Linux, you
could do (in tcsh, doesn't seem to work in bash):
tac FILE | ( rm FILE ; cat - > FILE )
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 09 Mar 2005 22:54:50 GMT
From: xhoster@gmail.com
Subject: Re: One Liner to reverse sort file
Message-Id: <20050309175449.977$UQ@newsreader.com>
xhoster@gmail.com wrote:
>
> If you want the reversed data written back to the same file, you could
> tie the file to an array with Tie::File, and then just reverse the array.
Come to think of it, that would also require the whole file to be memory
at once, unless you looped through the array reversing it in place.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Wed, 09 Mar 2005 17:23:40 +0100
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: p5 manager for whole file backups
Message-Id: <422f230c$0$18074$bb690d87@news.main-rheiner.de>
Lars Eighner wrote:
> Is there a module to manage whole-file backups in some sort
> of sane manner?
>
> I have in mind something I could sent a filespec and have
> a backup file with a unique name made, with old and/or supernumerary
> backups pruned, or have the filespec for the most recent backup
> returned, etc. I'd just as soon not re-invent the wheel.
>
>
I'm not sure I understand exactly what you need, but have a look at my
module File::VMSVersions on CPAN.
Thomas
--
$/=$,,$_=<DATA>,s,(.*),$1,see;__END__
s,^(.*\043),,mg,@_=map{[split'']}split;{#>J~.>_an~>>e~......>r~
$_=$_[$%][$"];y,<~>^,-++-,?{$/=--$|?'"':#..u.t.^.o.P.r.>ha~.e..
'%',s,(.),\$$/$1=1,,$;=$_}:/\w/?{y,_, ,,#..>s^~ht<._..._..c....
print}:y,.,,||last,,,,,,$_=$;;eval,redo}#.....>.e.r^.>l^..>k^.-
------------------------------
Date: Wed, 09 Mar 2005 11:39:23 -0500
From: Shawn Corey <shawn.corey@sympatico.ca>
Subject: Re: p5 manager for whole file backups
Message-Id: <%EFXd.20369$fW4.603217@news20.bellglobal.com>
Lars Eighner wrote:
> Is there a module to manage whole-file backups in some sort
> of sane manner?
>
> I have in mind something I could sent a filespec and have
> a backup file with a unique name made, with old and/or supernumerary
> backups pruned, or have the filespec for the most recent backup
> returned, etc. I'd just as soon not re-invent the wheel.
>
>
Have you searched CPAN scripts? <http://www.cpan.org/scripts/index.html>
--- Shawn
------------------------------
Date: Wed, 09 Mar 2005 11:56:10 -0500
From: Mark <Mark.Fenbers@NOSPAMnoaa.gov>
Subject: Perl code encryption
Message-Id: <d0n9rc$603$1@news.nems.noaa.gov>
I'm sure many have asked this question before... I don't want my code
to be read by humans for fear of "trade secrets" or proprietary
information being revealed through the code. What I want is a compiler
or encryptor to effectively convert my *.pl files to *.bin or *.exe
files (and I would keep the *.pl safe and distribute the binaries).
In C++ or Fortran, and many other languages, this is a no-brainer
because typically, the source is not distributed and the compiled binary is.
I tried the Perl compiler a year ago and just could not get it to work
on my code which is a collection of my code, CPAN modules, and
third-party licensed software. It may have come a long way since I last
tried it, though.
If you know of an elegant solution to compile or encrypt an executeable
version of my Perl code, could you please share with me this advice?
Mark
------------------------------
Date: Wed, 09 Mar 2005 10:19:17 -0700
From: Jeff Stampes <stampes@xilinx.com>
Subject: Re: Perl code encryption
Message-Id: <d0nb6l$bov3@xco-news.xilinx.com>
Mark wrote:
> I'm sure many have asked this question before...
Correct. Use the archives or Google.
> I don't want my code
> to be read by humans for fear of "trade secrets" or proprietary
> information being revealed through the code.
Then don't write in perl
> What I want is a compiler
> or encryptor to effectively convert my *.pl files to *.bin or *.exe
> files (and I would keep the *.pl safe and distribute the binaries).
See the FAQ: http://tinyurl.com/3pzsy
~Jeff
------------------------------
Date: Wed, 09 Mar 2005 13:35:24 -0500
From: Mark <Mark.Fenbers@NOSPAMnoaa.gov>
To: Jeff Stampes <stampes@xilinx.com>
Subject: Re: Perl code encryption
Message-Id: <422F41EC.3050407@NOSPAMnoaa.gov>
>> What I want is a compiler or encryptor to effectively convert my *.pl
>> files to *.bin or *.exe files (and I would keep the *.pl safe and
>> distribute the binaries).
>
> See the FAQ: http://tinyurl.com/3pzsy
>
Yes, I've read this, but the FAQ doesn't say what the compiler is or how
to use it, unless I missed it twice. I _DID_ however, manage to find
minimal info on using 'perl -MO=Bytecode myprog.pl > myprog.exe'. I
tried running the .exe (after chmod a+x), and got this error: 'Cannot
execute binary file'.
I suppose my follow-up question is how do I, or find info how to,
properly compile a Perl program into an executable?
Mark
------------------------------
Date: Wed, 09 Mar 2005 18:44:41 GMT
From: "H. Wade Minter" <minter@lunenburg.org>
Subject: Re: Perl code encryption
Message-Id: <tuHXd.4204$nZ.258975@twister.southeast.rr.com>
Mark <Mark.Fenbers@nospamnoaa.gov> wrote:
>>> What I want is a compiler or encryptor to effectively convert my *.pl
>>> files to *.bin or *.exe files (and I would keep the *.pl safe and
>>> distribute the binaries).
>>
>> See the FAQ: http://tinyurl.com/3pzsy
>>
> Yes, I've read this, but the FAQ doesn't say what the compiler is or how
> to use it, unless I missed it twice. I _DID_ however, manage to find
> minimal info on using 'perl -MO=Bytecode myprog.pl > myprog.exe'. I
> tried running the .exe (after chmod a+x), and got this error: 'Cannot
> execute binary file'.
>
> I suppose my follow-up question is how do I, or find info how to,
> properly compile a Perl program into an executable?
The best you'll get at present is PAR (http://par.perl.org/) - a great utility
that will package your Perl code and required modules into a Java JAR-like package,
or a standalone executable. It even has hooks into various filters that will
provide a degree of obsfuscation.
The standard disclaimers apply - even with the filters, it's reasonably trivial to
get to your "proprietary data." But PAR is good stuff.
--Wade
------------------------------
Date: Wed, 9 Mar 2005 13:16:52 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl code encryption
Message-Id: <slrnd2uit4.cms.tadmc@magna.augustmail.com>
Mark <Mark.Fenbers@NOSPAMnoaa.gov> wrote:
> I'm sure many have asked this question before...
So why are you boring everybody with it yet again?
Your Question is Asked Frequently:
perldoc -q hide
How can I hide the source for my Perl program?
You are expected to check the Perl FAQ *before* posting
to the Perl newsgroup.
> I don't want my code
> to be read by humans for fear of "trade secrets" or proprietary
> information being revealed through the code.
Consider choosing some programming language other than Perl then.
> What I want is a compiler
> or encryptor to effectively convert my *.pl files to *.bin or *.exe
Compiling is NOT encrypting.
Trade secrets can be stolen from compiled code too.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 10 Mar 2005 00:18:48 +0100
From: Dimitri Papoutsis <bastard@uni-koblenz.de>
Subject: Re: Perl code encryption
Message-Id: <d0ns8p$e09$1@news.uni-koblenz.de>
Mark wrote:
> minimal info on using 'perl -MO=Bytecode myprog.pl > myprog.exe'. I
> tried running the .exe (after chmod a+x), and got this error: 'Cannot
> execute binary file'.
perl -MByteLoader myprog.exe
------------------------------
Date: 9 Mar 2005 11:19:42 -0800
From: "noeldamonmiller@gmail.com" <noeldamonmiller@gmail.com>
Subject: perl-Cvs woes
Message-Id: <1110395982.420705.249820@g14g2000cwa.googlegroups.com>
All,
I'm trying to simply print a cvs status command and it isn't
working:
Here's the error
Can't modify constant item in scalar assignment at
script/report_revision.pl line 36, near ");"
BEGIN failed--compilation aborted at -e line 835 (#1)
(F) You aren't allowed to assign to the item indicated, or
otherwise try
to change it, such as with an auto-increment.
Uncaught exception from user code:
Can't modify constant item in scalar assignment at
script/report_revision.pl line 36, near ");"
BEGIN failed--compilation aborted at -e line 835.
Here's the script so far:
use Cvs;
use diagnostics;
use Carp;
use warnings;
# We plan to use PAR and archive all modules, so no worries about
having
# a full compliment of modules. Perhaps we'll even link perl and not
have
# to package it either
my $cvs = new Cvs
(
'/tmp/cvs/java/com/random',
cvsroot => '/usr/local/cvs',
password => 'secret'
) or die $Cvs::ERROR;
#my $status = $cvs->status();
#print "$REPORT_results\n";
Cvs::Result::StatusItem = $cvs->status();
Cvs::Result::StatusList = $cvs->status();
$cvs->logout();
I read the docs for Cvs, just don't get it..
Thanks for your help in advance.
Noel
------------------------------
Date: Wed, 9 Mar 2005 15:29:41 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: perl-Cvs woes
Message-Id: <slrnd2uqm5.d1h.tadmc@magna.augustmail.com>
noeldamonmiller@gmail.com <noeldamonmiller@gmail.com> wrote:
> Can't modify constant item in scalar assignment at
> script/report_revision.pl line 36, near ");"
^^^^^^^
^^^^^^^
> Here's the script so far:
[snip _25_ line program, with line numbers broken by word-wrap]
Show the real code if you expect real help.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 9 Mar 2005 14:40:17 -0800
From: "noeldamonmiller@gmail.com" <noeldamonmiller@gmail.com>
Subject: Re: perl-Cvs woes
Message-Id: <1110408017.720670.67980@z14g2000cwz.googlegroups.com>
ok, we take out the comments and get
use Cvs;
use diagnostics;
use Carp;
use warnings;
my $cvs = new Cvs
(
'/tmp/cvs/java/com/random',
cvsroot => '/usr/local/cvs',
password => 'secret'
) or die $Cvs::ERROR;
#my $status = $cvs->status();
#print "$REPORT_results\n";
Cvs::Result::StatusItem = $cvs->status();
Cvs::Result::StatusList = $cvs->status();
$cvs->logout();
------------------------------
Date: Wed, 9 Mar 2005 21:09:25 -0000
From: "Jeche Frijdel" <jfrijdel@hotmail.com>
Subject: Re: perlce (perl and perlide)
Message-Id: <fd-dnVjyT9aU-7LfRVnyvQ@brightview.com>
Yeah have just installed it, am new to perl, have hx4700, os 4.x, I had
similar problems setting up last night, but think you haven't set you
options correctly
downloaded 5.8.2 from http://perlce.sourceforge.net/ coped the releavent bin
and lib files into my iPaq store and then then downloaded the perlide and
uses that to set registry, seems to be working fine.
Good news you code works so its your setup... It runs on mine
Using PerlIde, I presume you have set all your paths in the perl/setup menu,
but in perl/options menu you also have to browse to your perl.exe in the
PerlPath actually click in perl.exe
Hope that helps
Regards
Jeche
I downloaded th
"ArcadeFX" <arcadefx@msn.com> wrote in message
news:1110314487.199171.244330@f14g2000cwb.googlegroups.com...
> Anyone use this application?
>
> I installed it and every time I try and run a perl script I get "exit
> -1" returned. This is from the PerlIDE. I did the cereg and I am not
> sure what to try next.
>
> Put it this way, I can't get the following code to work:
>
> begin--
>
> printf "hello world\n";
> <STDIN>;
>
> --end
>
> Any suggestions or how to run "perl.exe" on wince?
>
------------------------------
Date: Wed, 9 Mar 2005 21:35:33 -0000
From: "Jeche Frijdel" <jfrijdel@hotmail.com>
Subject: Re: perlce (perl and perlide)
Message-Id: <JJqdnVIZxqy18bLfRVnytg@brightview.com>
Oh yeah, I forgot, if you installed your perlce from
http://www.rainer-keuchel.de/wince/perlce.html it isnt the full package,
hence why I pointed you at the 5.8.2 distro.
"Jeche Frijdel" <jfrijdel@hotmail.com> wrote in message
news:fd-dnVjyT9aU-7LfRVnyvQ@brightview.com...
> Yeah have just installed it, am new to perl, have hx4700, os 4.x, I had
> similar problems setting up last night, but think you haven't set you
> options correctly
>
> downloaded 5.8.2 from http://perlce.sourceforge.net/ coped the releavent
> bin and lib files into my iPaq store and then then downloaded the perlide
> and uses that to set registry, seems to be working fine.
>
> Good news you code works so its your setup... It runs on mine
>
>
> Using PerlIde, I presume you have set all your paths in the perl/setup
> menu, but in perl/options menu you also have to browse to your perl.exe in
> the PerlPath actually click in perl.exe
>
> Hope that helps
>
> Regards
> Jeche
>
>
>
>
>
>
>
>
>
> I downloaded th
> "ArcadeFX" <arcadefx@msn.com> wrote in message
> news:1110314487.199171.244330@f14g2000cwb.googlegroups.com...
>> Anyone use this application?
>>
>> I installed it and every time I try and run a perl script I get "exit
>> -1" returned. This is from the PerlIDE. I did the cereg and I am not
>> sure what to try next.
>>
>> Put it this way, I can't get the following code to work:
>>
>> begin--
>>
>> printf "hello world\n";
>> <STDIN>;
>>
>> --end
>>
>> Any suggestions or how to run "perl.exe" on wince?
>>
>
>
------------------------------
Date: Wed, 9 Mar 2005 09:30:37 -0800
From: Steven Kuo <skuo@mtwhitney.nsc.com>
Subject: Re: perlpod/perldoc Q: I want asterisk bullets
Message-Id: <Pine.GSO.4.21.0503090927050.14616-100000@mtwhitney.nsc.com>
On Wed, 9 Mar 2005, J Krugman wrote:
>
>
> OK, here's an example that exhibits some annoying behavior:
>
> =over
>
> =item *
>
> whatever:
>
> =over
>
> =item *
>
> first item
>
> =item *
>
> second item
>
> =item *
>
> etc., etc.
>
> =back
>
> =back
>
>
>
> It looks like this when displayed using perl/perldoc v5.8.4:
>
>
>
> TEST(1) User Contributed Perl Documentation TEST(1)
>
>
>
> o whatever:
>
> o first item
>
> o second item
>
> o etc., etc.
>
>
>
> perl v5.8.4 2005-03-08 TEST(1)
>
>
> If I change the very first =item line in the source to
>
> =item ?
>
> where ? stands for anything other than *, the outer bullet is
> rendered as ? (whatever it is) and the inner bullets are rendered
> as *'s. But I have not found the incantation to render all bullets
> as *'s.
>
> jill
Try using the null formating code for the first bullet (see perldoc
perlpod):
=over
=item Z<>*
whatever:
=over
=item *
first item
etc.
Works here (v5.8.6 built for sun4-solaris).
--
Hope this helps,
Steven
------------------------------
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 V10 Issue 7871
***************************************