[19595] in Perl-Users-Digest
Perl-Users Digest, Issue: 1790 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 22 00:05:32 2001
Date: Fri, 21 Sep 2001 21:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1001131508-v10-i1790@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 21 Sep 2001 Volume: 10 Number: 1790
Today's topics:
Best way to hide the perl source code.. <jkumar@atrenta.com>
Re: Best way to hide the perl source code.. (John J. Trammell)
Re: Best way to hide the perl source code.. <wyzelli@yahoo.com>
Re: Best way to hide the perl source code.. <dan@tuatha.sidhe.org>
Re: Best way to hide the perl source code.. (Michael Houghton)
Re: Best way to hide the perl source code.. <dan@tuatha.sidhe.org>
File::Find::name problem... (Rob)
fold in perl <jamie_bohr@agilent.com>
Re: fold in perl <glex@qwest.net>
Re: fold in perl (Mark Jason Dominus)
Re: fold in perl (Damian Conway)
Re: Hash problem... <ren@tivoli.com>
Re: installing modules in WinNT <skradel@mindspring.common.sense>
Perl and plain Win32 GUI programming <aflow@mail.com>
Re: Perl and plain Win32 GUI programming <bart.lateur@skynet.be>
Re: Problem with Object Oriented Perl <bart.lateur@skynet.be>
Re: Process ID (David Efflandt)
Re: Process ID <bart.lateur@skynet.be>
Re: Simple question <bob@offend.org>
Re: String comparison <ren@tivoli.com>
Re: Transfer localtime to MET <glex@qwest.net>
use of uninitialized value using join (q777)
Re: use of uninitialized value using join <davidhilseenews@yahoo.com>
Re: use of uninitialized value using join (John J. Trammell)
Re: use of uninitialized value using join <bart.lateur@skynet.be>
Re: Using 'use lib' to throw an arbitrary directory int <kevin@vaildc.net>
Re: Which Version............please? <bob@offend.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 21 Sep 2001 18:06:21 -0700
From: Jayakumar Mundunuri <jkumar@atrenta.com>
Subject: Best way to hide the perl source code..
Message-Id: <3BABE40D.82225D00@atrenta.com>
Hi Friends!!
Can you suggest me what is the best way to hide perl source code?
perl Compiler/ perlcc / perl Bite code / encrypt / perl Filter ....
I heard the above names but not really attempted to use them.
It would be great help if anybody guide me with some references.
Thanks in advance.
jay
------------------------------
Date: 22 Sep 2001 01:40:11 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: Best way to hide the perl source code..
Message-Id: <slrn9qnqvq.r3m.trammell@haqq.hypersloth.net>
On Fri, 21 Sep 2001 18:06:21 -0700, Jayakumar Mundunuri wrote:
>
> Can you suggest me what is the best way to hide perl source code?
>
If I _told_ you, it wouldn't be _secure_ now, would it?
Let's just say that it's *not* buried in a coffee can in
the back yard. No sir.
------------------------------
Date: Sat, 22 Sep 2001 11:46:46 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Best way to hide the perl source code..
Message-Id: <H9Sq7.3$Lj3.576@wa.nnrp.telstra.net>
"John J. Trammell" <trammell@haqq.hypersloth.invalid> wrote in message
news:slrn9qnqvq.r3m.trammell@haqq.hypersloth.net...
> On Fri, 21 Sep 2001 18:06:21 -0700, Jayakumar Mundunuri wrote:
> >
> > Can you suggest me what is the best way to hide perl source code?
> >
>
> If I _told_ you, it wouldn't be _secure_ now, would it?
>
I dunno about that. i know where Fort Knox is, and it is secure (isn't
it?).
Wyzelli
--
#Modified from the original by Jim Menard
for(reverse(1..100)){$s=($_==1)? '':'s';print"$_ bottle$s of beer on the
wall,\n";
print"$_ bottle$s of beer,\nTake one down, pass it around,\n";
$_--;$s=($_==1)?'':'s';print"$_ bottle$s of beer on the
wall\n\n";}print'*burp*';
------------------------------
Date: Sat, 22 Sep 2001 01:53:17 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Best way to hide the perl source code..
Message-Id: <haSq7.24602$NT3.3351334@news1.rdc1.ct.home.com>
Jayakumar Mundunuri <jkumar@atrenta.com> wrote:
> Hi Friends!!
> Can you suggest me what is the best way to hide perl source code?
use Bleach;
------------------------------
Date: 21 Sep 2001 22:12:30 -0400
From: herveus@Radix.Net (Michael Houghton)
Subject: Re: Best way to hide the perl source code..
Message-Id: <9ogs2e$qgn$1@saltmine.radix.net>
Howdy!
In article <haSq7.24602$NT3.3351334@news1.rdc1.ct.home.com>,
Dan Sugalski <dan@tuatha.sidhe.org> wrote:
>Jayakumar Mundunuri <jkumar@atrenta.com> wrote:
>> Hi Friends!!
>
>> Can you suggest me what is the best way to hide perl source code?
>
>use Bleach;
>
That's Acme::Bleach...
yours,
Michael
--
Michael and MJ Houghton | Herveus d'Ormonde and Megan O'Donnelly
herveus@radix.net | White Wolf and the Phoenix
Bowie, MD, USA | Tablet and Inkle bands, and other stuff
| http://www.radix.net/~herveus/
------------------------------
Date: Sat, 22 Sep 2001 02:27:19 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Best way to hide the perl source code..
Message-Id: <bGSq7.24738$NT3.3361554@news1.rdc1.ct.home.com>
Michael Houghton <herveus@radix.net> wrote:
> Howdy!
> In article <haSq7.24602$NT3.3351334@news1.rdc1.ct.home.com>,
> Dan Sugalski <dan@tuatha.sidhe.org> wrote:
>>Jayakumar Mundunuri <jkumar@atrenta.com> wrote:
>>> Hi Friends!!
>>
>>> Can you suggest me what is the best way to hide perl source code?
>>
>>use Bleach;
>>
> That's Acme::Bleach...
Ah, right, they renamed it.
Acme::Buffy would work too. And Acme::DWIM isn't that bad either...
Dan
------------------------------
Date: 21 Sep 2001 19:23:20 -0700
From: robsjobs@hotmail.com (Rob)
Subject: File::Find::name problem...
Message-Id: <4ae33a7b.0109211823.272b4ca5@posting.google.com>
I have searched and searched for the answer to the great riddle before
me. I am stumped! My text's don't talk much about the type of work I
am doing and I am lost.
This is NT 4.0 with ActiveState perl, v5.6.1 built for
MSWin32-x86-multi-thread
I have a directory named:
"h:/content/" #Active state converts the path delimiter "\" to "/"
Within the directory I have 100 subdirectories named [1-99]
within each subdirectory are files named (for instance):
"1/101" and "4/44504" and "34/569834" and "97/12397"
Notice the file is in a "bucket" which is an integer value of the last
(one or) two numbers in the filename.
So my quandry, I return a database list of what is active and I have
to determine if I have extra's (orphans) or missing and then the
number of matches. I found another example from 1998 which has helped
a lot but I am struggling in one area. I use find, see below:
find sub {
printf("%s%s",substr($File::Find::name, 2),"\n") if ( -f &&
/^[0-9]*/ )
}, ".";
But the kicker is this... I also have two subdirectories at the same
level as [1-99]. They are named "manifest" and "orphans" because
orphans live 24hrs after purging incase something happens with the
manifest procedure.
The code above (regex in particular) does not exclude the alpha
directories. The output without the substr is "./21/3421" and
"./manifest/done.Manifest.NODE1" and "./orphans/56601". I only want
the directories that (with substr) are "34/1234" and "75/75" and "4/4"
and "99/100099".
Please help :-)
Thank you.
Robert
------------------------------
Date: Fri, 21 Sep 2001 17:05:29 -0600
From: "Jamie R. Bohr" <jamie_bohr@agilent.com>
Subject: fold in perl
Message-Id: <1001113532.881533@goodnews.cos.agilent.com>
Has any one developed a fold for perl? I know format(write) can do it but I
have not figured out how to it write to a string.
I know about the swrite and how that works, I just have not figured out a
why to make it work with the following:
sub JUSTIFY {
my($Input, $Justify) = @_;
my @LineBreaks;
format LEFT =
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$Input
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
~~
$Input
.
format CENTER =
^|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$Input
^|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
~~
$Input
.
format RIGHT =
^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$Input
^>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
~~
$Input
.
if($Justify =~ /left/i ||
!defined($Justify)) { $Justify = "LEFT"; }
elsif($Justify =~ /center/i) { $Justify = "CENTER"; }
elsif($Justify =~ /right/i) { $Justify = "RIGHT"; }
else {
printf(STDERR "\n\nJustification was set to left - default
setting\n\n");
$Justify = "LEFT"; # Default
}
@LineBreaks = split /^/m, "$Input";
for(@LineBreaks) {
$Input = $_;
$~ = $Justify;
write;
}
}
$Mesg = "some long message I want to format and make look pretty";
$Mesg = &JUSTIFY("$Mesg", LEFT);
------------------------------
Date: Fri, 21 Sep 2001 19:40:46 -0500
From: Jeff Gleixner <glex@qwest.net>
Subject: Re: fold in perl
Message-Id: <3BABDE0E.BA5B878B@qwest.net>
"Jamie R. Bohr" wrote:
>
> Has any one developed a fold for perl? I know format(write) can do it but I
> have not figured out how to it write to a string.
use Text::Format;
or
use Text::Autoformat;
They're both on CPAN.
http://theoryx5.uwinnipeg.ca/CPAN/data/Text-Format/Text/Format.html
http://theoryx5.uwinnipeg.ca/CPAN/data/Text-Autoformat/Text/Autoformat.html
--
Jeff Gleixner
Steven Wright Saying of the moment:
I saw a small bottle of cologne and asked if it was for sale.
She said, "It's free with purchase." I asked her if anyone
bought anything today.
------------------------------
Date: Sat, 22 Sep 2001 01:20:54 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: fold in perl
Message-Id: <3babe776.4e15$112@news.op.net>
In article <1001113532.881533@goodnews.cos.agilent.com>,
Jamie R. Bohr <jamie_bohr@agilent.com> wrote:
>Has any one developed a fold for perl? I know format(write) can do it but I
>have not figured out how to it write to a string.
Perl comes with a module called 'Text::Wrap' that does this.
Try
man Text::Wrap
or
perldoc Text::Wrap
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: 22 Sep 2001 01:41:25 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: fold in perl
Message-Id: <9ogq85$dd6$1@towncrier.cc.monash.edu.au>
Jeff Gleixner <glex@qwest.net> writes:
>"Jamie R. Bohr" wrote:
>>
>> Has any one developed a fold for perl? I know format(write) can do it but I
>> have not figured out how to it write to a string.
>use Text::Format;
>or
>use Text::Autoformat;
Text::Reform (the actual text-wrapping engine used inside Text::Autoformat)
might be more appropriate here.
Damian
------------------------------
Date: 21 Sep 2001 17:31:15 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Hash problem...
Message-Id: <m3itecgor0.fsf@dhcp9-161.support.tivoli.com>
On Fri, 21 Sep 2001, guardian@chello.be wrote:
> Ok now I have this to store the data
>
> if ( $event1 = "killed" ) {
> $$player_name{kills}{count}++; # Player kills
> $$player_name{kills}{victim}{$player_name2}++;
> $$player_name{kills}{weapon}{$noun2}++;
> $$player_name2{death}{count}++; # Player death
> $$player_name2{death}{killer}{$player_name}++;
> $$player_name2{death}{weapon}{$noun2}++;
> }
First of all, the choice of $player_name and $player_name2 as your
hash references leads me to conclude that you are using symbolic
references. If so, that is a bad thing. In this case, it is *very*
easy to avoid. If $player_name contains the (unique) name of one
player and $player_name2 another, then just use something like:
$player{$player_name}{kills}{count}++;
$player{$player_name2}{death}{count}--;
> And this to retrieve data...
>
> foreach $user ( keys %player ) {
> print "$user\n";
> print "### Kills: $$user{kills}{count}\n";
> print "### Death: $$user{death}{count}\n";
> print "\n";
> }
This would change to:
print "### Kills: $player{$user}{kills}{count}\n";
> But when I try do get the other infos... I got a syntax error...
> Perl don't accept keys %player{kills}
Yeah, that's pretty much invalid syntax all around. You're presumably
looking for %{$$user{kills}} or %{$user->{kills}}, though if you
switch to what I recommend then it would be %{$player{$user}{$kills}}.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Fri, 21 Sep 2001 20:33:15 -0400
From: "Steve K" <skradel@mindspring.common.sense>
Subject: Re: installing modules in WinNT
Message-Id: <9ogm8d$2o8$1@slb7.atl.mindspring.net>
"Eli the Bearded" <eli@there-is-no-more-qzto.com> wrote in message
news:eli$0109211222@qz.little-neck.ny.us...
> In comp.lang.perl.misc, asif <whatever@nevermind.invalid> wrote:
> Modules install nicely, double clicking perl scripts works, but I can't
> right click and 'Open With...' perl scripts. Anything simple to fix
> that?
Pick "Open With... -> Choose Program" after the right click, and specify the
perl interpreter. Windows will/should/might remember that decision and,
thereafter, offer it on the "Open With" menu.
> Elijah
> ------
> vastly prefers not using Windows
An easy argument to make, for them who like perl...
--Steve
------------------------------
Date: Sat, 22 Sep 2001 02:15:47 +0400
From: "aflow" <aflow@mail.com>
Subject: Perl and plain Win32 GUI programming
Message-Id: <9oge5b$ob7$1@news.sovam.com>
I view Perl as an extremely powerful language and I'm very
proficient in plain (old-style) Win32 programming in C.
Have anybody here had an experience in implementing Win32
GUI applications in Perl (besides of using tk)? Is it
difficult to tie Perl abstractions to C-based Win32 API?
I don't like references to Perl user guides here...
How about implementing, for ex., a window function:
LRESULT CALLBACK MainWndProc (HWND hWnd, UINT wMsg,
WPARAM wParam, LPARAM lParam)
{
// ...
}
--
Alex Protasov
A-Flow development, customer support
A-Flow - Software Applications Visual Designer
http://aflow-designer.com
------------------------------
Date: Sat, 22 Sep 2001 01:16:28 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Perl and plain Win32 GUI programming
Message-Id: <s7pnqtop6l2p5gitl8laotmf8uctnrgad6@4ax.com>
aflow wrote:
>Have anybody here had an experience in implementing Win32
>GUI applications in Perl (besides of using tk)? Is it
>difficult to tie Perl abstractions to C-based Win32 API?
>
>How about implementing, for ex., a window function:
>
>LRESULT CALLBACK MainWndProc (HWND hWnd, UINT wMsg,
>WPARAM wParam, LPARAM lParam)
I think Win32::GUI takes that approach. I haven't tried it myself,
though...
>I don't like references to Perl user guides here...
OK. <http://dada.perl.it/#gui>.
--
Bart.
------------------------------
Date: Sat, 22 Sep 2001 00:43:58 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Problem with Object Oriented Perl
Message-Id: <74nnqtgtgvn3gp8kch1gmsn2pr6s29tmac@4ax.com>
Randal L. Schwartz wrote:
>>>>>> "Thomas" == Thomas Bätzler <Thomas@Baetzler.de> writes:
>
>Thomas> Try instead:
>
>Thomas> sub new {
>Thomas> my $proto = shift;
>Thomas> # get proper classname
>Thomas> my $class = ref( $proto ) || $proto;
>
>replace this with
>
> my $class = shift;
>
>for reasons explained in and near
>
> http://www.perlmonks.org/index.pl?node_id=52089
>
>ref($proto) - a bad idea as a *default pattern* that has gone too far.
>Just say no.
I wholeheartedly dissagree. You call this "cargo cult"? Cargo cult is
where something doesn't work, although it appears as if it should work.
This works, even though it doesn't look like it, even under unusual
circumstances. Yours, instead, gives weird results under the same
circumstances. Is that what you want? Simple code that results in
difficult to debug programs? Look:
my $foo = bless {}, 'Foo';
my $bar = bless {}, $foo;
print "\$bar = '$bar'\nref(\$bar) = '@{[ref($bar)]}'\n";
This does NOT FAIL. This does not even give a warning. Yet $bar will
belong to a pretty strange class, as can be seen from what it prints:
$bar = 'Foo=HASH(0x176f134)=HASH(0x176f20c)'
ref($bar) = 'Foo=HASH(0x176f134)'
Is that really what you want? No, not even 'strict' prevents this.
Now, if only bless() would either automatically take ref() from what it
blesses into if it is a reference (ooh, even sillier than what you
protest against), or at least it could warn, or even die.
But now: nothing at all. At least this "cargo cult" succeeds in making
some sense of it. For those who can't quite follow: it would have
blessed $bar into "Foo", not into "Foo=HASH(0x176f134)", and that's a
string, not a reference that gets printed like a string.
--
Bart.
------------------------------
Date: Sat, 22 Sep 2001 00:05:18 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Process ID
Message-Id: <slrn9qnldt.nvf.efflandt@typhoon.xnet.com>
On Fri, 21 Sep 2001 10:25:40 +0200, Dahlin <dahlin.jkpg@swipnet.se> wrote:
> Im developing an cgi -application i perl.
> This application i call three times from whitin a webpage.
>
> The problem is i nedd to get a random number each time, but since all three
> calls occur within a second, i cant use just time() as seed. And all tree
> calls get the same processid, unless i change the querystring.
>
> How do i solve this?
> Why do they have the same processID?
Process ID of current process is $$, or of a child process is explained in
'perldoc perlipc'.
You are apparently trying to create some other random ID to identify these
processes (a random number is _not_ guaranteed to be unique). Your
mistake is not reading the following in 'perldoc -f srand':
Do _not_ call srand() multiple times in your program unless you know
exactly what you're doing and why you're doing it. The point of the
function is to "seed" the rand() function so that rand() can produce a
different sequence each time you run your program. Just do it once at the
top of your program, or you _won't_ get random numbers out of rand()!
--
David Efflandt - All spam is ignored - http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: Sat, 22 Sep 2001 02:01:31 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Process ID
Message-Id: <4trnqtcopcbjjm56u0lvdbvo3anc6vgdj6@4ax.com>
Dahlin wrote:
>Im developing an cgi -application i perl.
>This application i call three times from whitin a webpage.
>
>The problem is i nedd to get a random number each time, but since all three
>calls occur within a second, i cant use just time() as seed. And all tree
>calls get the same processid, unless i change the querystring.
>
>How do i solve this?
>Why do they have the same processID?
Caching of the resulting page. Very dangerous, even if indeed you would
succeed in generating a different ID every time. The header
"Cache-Control: No cache" can deal with that.
But even then there isn't a 100% garantee that you'll get a different
process ID, because those process ID's get recycled eventually, and
there's no telling how short in time the cycle will be.
--
Bart.
------------------------------
Date: Fri, 21 Sep 2001 23:06:23 -0400
From: "bob" <bob@offend.org>
Subject: Re: Simple question
Message-Id: <tqo01jtjl2bg7a@corp.supernews.com>
no need to get your panties in a twist over it...
<nobull@mail.com> wrote in message news:u9hetwecxi.fsf@wcl-l.bham.ac.uk...
> mauroid@csi.forth.gr (Dimitri) writes:
>
> > Subject: Simple question
>
> Please use the subject line of your post to describe the subject of
> your post. 'Cute' meta-non-information is just plain rude.
>
> > A very simple Perl question: Having a string say in $s, how can I count
> > how many times the character 'a' appears in the string?
>
> See FAQ: "How can I count the number of occurrences of a substring
> within a string?"
>
> You are supposed to consult the FAQ _before_ you post. Pop quiz: Can
> you guess _why_ you are supposed to consult the FAQ _before_ you post?
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
------------------------------
Date: 21 Sep 2001 17:39:19 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: String comparison
Message-Id: <m3elp0godk.fsf@dhcp9-161.support.tivoli.com>
On 21 Sep 2001, sami@xenetic.fi wrote:
> hello there,
>
> Here is a simple string comparison code. I wonder why
> only step #2 returns match. Does anybody have some ideas.
>
> Code:
> -----------------------------------------------------------
> #!/usr/bin/perl
>
> $line = 'find or open file something, errno = 2. (43)';
> $string1 = 'errno = 2. (43)';
Because "(" and ")" (and ".", though that doesn't matter in this case)
have special meanings in regexes. You need to escape them. Better
yet, if you are searching for literal strings, use index().
> $string2 = 'or open file';
>
> #Step 1
> if ($line =~ /$string1/) {
if ($line =~ /\Q$string1/) {
or
if (index($line, $string1) != -1) {
> print "Step 1 match\n";
> }
>
> #Step 2
>
> if ($line =~ /$string2/) {
> print "Step 2 match\n";
> }
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Fri, 21 Sep 2001 19:00:21 -0500
From: Jeff Gleixner <glex@qwest.net>
Subject: Re: Transfer localtime to MET
Message-Id: <3BABD495.301E20B1@qwest.net>
"F.L.M. van der Valk" wrote:
>
> In a Perl-program I use for a scouting-website is mentioned :
>
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
>
> $long_date = sprintf("%s %02d, %4d at
> %02d:%02d:%02d",$months[$mon],$mday,$year,$hour,$min,$sec);
>
> The server is in the USA so, time difference is 6 hrs.
>
> How can I change it, so the MET (The Netherlands) is mentioned.
Since you know it's 6 hours:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time -
(3600 *6));
However if that server changes, it's better to set $ENV{TZ}
appropriately before calling time().
$ENV{TZ}='MET-1METDST'; #??? dunno if that's your correct zone.
my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);
--
Jeff Gleixner
Quote/Saying of the moment:
If you can remain calm, you don't have all the facts.
------------------------------
Date: 21 Sep 2001 17:17:52 -0700
From: quang777@email.com (q777)
Subject: use of uninitialized value using join
Message-Id: <9f14310.0109211617.8503ea2@posting.google.com>
Ok, very simple piece of code (using the -Tw switch)
my @array = ();
my $string = join /\n/, @array;
why does this give the "Use of uninitialized value" error?
I thought it was b/c I didn't initialize the array, but isn't this the
correct way to intialize an array? Thanks
------------------------------
Date: Sat, 22 Sep 2001 00:29:46 GMT
From: "David Hilsee" <davidhilseenews@yahoo.com>
Subject: Re: use of uninitialized value using join
Message-Id: <_XQq7.2195$n_2.283521@news1.rdc1.md.home.com>
"q777" <quang777@email.com> wrote in message
news:9f14310.0109211617.8503ea2@posting.google.com...
> Ok, very simple piece of code (using the -Tw switch)
>
> my @array = ();
> my $string = join /\n/, @array;
>
> why does this give the "Use of uninitialized value" error?
>
> I thought it was b/c I didn't initialize the array, but isn't this the
> correct way to intialize an array? Thanks
Well...
$ perl -we 'my @array=(); my $string = join " ", @array;'
$ perl -we 'my @array=(); my $string = join / /, @array;'
/ / should probably be written as " " at -e line 1.
Use of uninitialized value in pattern match (m//) at -e line 1.
--
David Hilsee
------------------------------
Date: 22 Sep 2001 01:49:13 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: use of uninitialized value using join
Message-Id: <slrn9qnrgp.r50.trammell@haqq.hypersloth.net>
On 21 Sep 2001 17:17:52 -0700, q777 <quang777@email.com> wrote:
> Ok, very simple piece of code (using the -Tw switch)
>
> my @array = ();
> my $string = join /\n/, @array;
^^^^
Shirley you mean "\n"?
[ ~ ] perl -wT -e '@x=();$y=join("\n",@x);'
Name "main::y" used only once: possible typo at -e line 1.
[ ~ ] perl -wT -e '@x=();$y=join(/\n/,@x);'
Name "main::y" used only once: possible typo at -e line 1.
Use of uninitialized value at -e line 1.
[ ~ ]
------------------------------
Date: Sat, 22 Sep 2001 01:55:06 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: use of uninitialized value using join
Message-Id: <rornqt8klreqhau0mihcj1mp256n6dndio@4ax.com>
q777 wrote:
>my @array = ();
>my $string = join /\n/, @array;
>
>why does this give the "Use of uninitialized value" error?
Because you're joining using a regex instead of a plain string, which
does matching on $_, which in turn is undefined?
--
Bart.
------------------------------
Date: Fri, 21 Sep 2001 21:37:57 -0400
From: Kevin Michael Vail <kevin@vaildc.net>
Subject: Re: Using 'use lib' to throw an arbitrary directory into @INC at runtime?
Message-Id: <210920012137575267%kevin@vaildc.net>
In article <KvTo7.1358$p77.2997@www.newsranger.com>, Weston Cann
<nospam@newsranger.com> wrote:
> I'm trying to figure out how to use 'use lib' to throw an arbitrary directory
> into @INC at runtime (as one might suspect from the Subject line of my post).
>
> The code that I'm trying to use is:
>
> use lib $arbitraryDir;
>
> This doesn't seem to work... should it?
Not like that. But what you can do is something like this:
require lib;
lib->import($arbitraryDir);
This is basically a use that gets deferred until runtime (actually, of
course, use is basically the above executed at compile time :-) ).
--
Kevin Michael Vail | a billion stars go spinning through the night,
kevin@vaildc.net | blazing high above your head.
. . . . . . . . . | But _in_ you is the presence that
. . . . . . . . . | will be, when all the stars are dead. (Rainer Maria Rilke)
------------------------------
Date: Fri, 21 Sep 2001 23:02:28 -0400
From: "bob" <bob@offend.org>
Subject: Re: Which Version............please?
Message-Id: <tqnvqlebndc3f6@corp.supernews.com>
most definitely activestate.
"Laocoon" <Laocoon@eudoramail.com> wrote in message
news:Xns911848D784EB3Laocooneudoramail@62.153.159.134...
> "Dabhar" <dabhar@dabhar.org> wrote in
> news:x4Wm7.156400$B37.3497955@news1.rdc1.bc.home.com:
>
> > Thanks for reading my post. I'm trying to figure out which distribution
> > of Perl to start with. I'm working on a windows machine,
> *snip*
>
> If your working on Windows i'd recommend using ActiveState
------------------------------
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.
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 1790
***************************************