[28654] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 10018 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 29 06:05:55 2006

Date: Wed, 29 Nov 2006 03:05:08 -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, 29 Nov 2006     Volume: 10 Number: 10018

Today's topics:
    Re: Bareword errors? <cwilbur@chromatico.net>
    Re: CGI parsing (was: Bareword errors?) <cwilbur@chromatico.net>
        Hash of arrays & 'values' function <usenet@fkspam.org>
    Re: Hash of arrays & 'values' function <nobull67@gmail.com>
    Re: Hash of arrays & 'values' function <noreply@gunnar.cc>
    Re: Hash of arrays & 'values' function <usenet@fkspam.org>
        How do I get rid of this warning? <ro.naldfi.scher@gmail.com>
    Re: How do I get rid of this warning? <bik.mido@tiscalinet.it>
    Re: line breaks <spamtrap@dot-app.org>
        new CPAN modules on Wed Nov 29 2006 (Randal Schwartz)
        NRN again <reviewyourdemo@hotmail.com>
        NRN <reviewyourdemo@hotmail.com>
    Re: Perl/Mail Suggestion.... <antispam@randometry.com>
    Re: regex matching exactly 10 digits <abigail@abigail.be>
    Re: relax <spamtrap@dot-app.org>
    Re: relax <bik.mido@tiscalinet.it>
    Re: rewrite <bik.mido@tiscalinet.it>
    Re: rewrite <bik.mido@tiscalinet.it>
        sharing a  variable across two scripts. <rajendra.prasad@in.bosch.com>
    Re: sharing a  variable across two scripts. <spamtrap@dot-app.org>
    Re: sharing a  variable across two scripts. <rajendra.prasad@in.bosch.com>
    Re: sharing a  variable across two scripts. <spamtrap@dot-app.org>
        Something likes crontab on Unix. <moreno@tututico.it>
    Re: Something likes crontab on Unix. <spamtrap@dot-app.org>
    Re: Something likes crontab on Unix. <antispam@randometry.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 29 Nov 2006 01:53:40 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Bareword errors?
Message-Id: <87k61ekakr.fsf@mithril.chromatico.net>

>>>>> "SP" == Sherm Pendley <spamtrap@dot-app.org> writes:

    >> There were also big back and forths on the newsgroup by those
    >> more knowledgable than I (that would be everyone) about the
    >> pluses and minuses of cgi.pm.

    SP> I highly doubt that. 

She whom I am not going to name - but she misspelled both Perl and
Girl in her nom de net - delivered frequent tirades about how useless
CGI.pm was.  This might easily have been mistaken for a "big back and
forth" with significant support on both sides, especially as there
were more reasonable people who stepped forth with more nuanced
opinions about various parts of the CGI.pm module.

Charlton


-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: 29 Nov 2006 02:02:41 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: CGI parsing (was: Bareword errors?)
Message-Id: <87ejrmka5q.fsf@mithril.chromatico.net>

>>>>> "GH" == Gunnar Hjalmarsson <noreply@gunnar.cc> writes:

    GH> I have never understood why some regulars here get so upset as
    GH> soon as they see a piece of trivial CGI parsing code.

Because CGI parsing is not trivial.  It's the same reaction I have to
parsing HTML or XML with a complicated regular expression, or using
regular expressions for arithmetic: the fact that someone's trying it
seriously in the first place shows that they don't understand the
problem or the tool.

It's not a matter of being upset.  It's a reaction to someone doing
something that is, in the vast majority of scenarios, somewhere
between misguided and idiotic; and in those scenarios where it isn't
counterproductive, there are other solutions with a much better return
on the investment of time.

Charlton


-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Wed, 29 Nov 2006 09:03:21 +0000
From: Ben Tisdall <usenet@fkspam.org>
Subject: Hash of arrays & 'values' function
Message-Id: <aLCdnQnzqIhG0fDYnZ2dnUVZ8q-dnZ2d@pipex.net>

Hi, hope I'm asking this in the correct place (I'm at the "'Learning 
Perl' was a breeze" but "'Programming Perl' is frequently making my head 
hurt'"stage...)

Anyhoo, I need to store info about which hosts users are logged into & 
since they might be logged into more than one I'm using a hash of arrays.

Getting data in & pulling it out based on each key is no problem, but 
what if I want to get a list of all machines currently logged into? I 
know I can iterate over the hash using 'keys' & build a simple array of 
all the hosts like this:

foreach (keys%userlist) {
         push(@all,@{$userlist{$_}});
}

But it seems to me that this is unnecessarily expensive & I should be 
able to use 'values' to get at the list.

I understand that values%userlist isn't right, but what is?

TIA.

-- 
Ben Tisdall


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

Date: 29 Nov 2006 01:19:26 -0800
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Hash of arrays & 'values' function
Message-Id: <1164791966.723206.220660@h54g2000cwb.googlegroups.com>



On Nov 29, 9:03 am, Ben Tisdall <use...@fkspam.org> wrote:
> Hi, hope I'm asking this in the correct place (I'm at the "'Learning
> Perl' was a breeze" but "'Programming Perl' is frequently making my head
> hurt'"stage...)
>
> Anyhoo, I need to store info about which hosts users are logged into &
> since they might be logged into more than one I'm using a hash of arrays.
>
> Getting data in & pulling it out based on each key is no problem, but
> what if I want to get a list of all machines currently logged into? I
> know I can iterate over the hash using 'keys' & build a simple array of
> all the hosts like this:
>
> foreach (keys%userlist) {
>          push(@all,@{$userlist{$_}});
> }

> But it seems to me that this is unnecessarily expensive & I should be
> able to use 'values' to get at the list.
>
> I understand that values%userlist isn't right, but what is?

Yes it is, but you still need to dereference the array references.

foreach (values %userlist) {
         push(@all,@$_);
}

Or

my @all = map { @$_ } values %userlist;



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

Date: Wed, 29 Nov 2006 10:41:58 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Hash of arrays & 'values' function
Message-Id: <4t52v8F12ks89U1@mid.individual.net>

Ben Tisdall wrote:
> I understand that values%userlist isn't right, but what is?

If I understood you correctly

     keys %userlist

is what you want.

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


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

Date: Wed, 29 Nov 2006 10:22:08 +0000
From: Ben Tisdall <usenet@fkspam.org>
Subject: Re: Hash of arrays & 'values' function
Message-Id: <G5SdnYCu-uvNwvDYRVnyug@pipex.net>

Gunnar Hjalmarsson wrote:
> Ben Tisdall wrote:
>> I understand that values%userlist isn't right, but what is?
> 
> If I understood you correctly
> 
>     keys %userlist
> 
> is what you want.
> 

Thanks, but I was curious about the most efficient way to return a list 
consisting of the all values in the nested arrays.

Thanks to the Brian for his solutions.


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

Date: 29 Nov 2006 00:13:22 -0800
From: "Ronny" <ro.naldfi.scher@gmail.com>
Subject: How do I get rid of this warning?
Message-Id: <1164788002.089867.119570@n67g2000cwd.googlegroups.com>

Patterned after the solution suggested in the perlmodlib man page, I
wrote the following code:

==================== This is file b.pm
#!/usr/local/bin/perl -w
use strict;
package b;
sub f { print "BBBBBBBB @_\n"; }
eval join('', <main::DATA>) || die $@ unless caller();
1
__END__
package main;
b::f(@ARGV);
=================================

When called this from the command line, say:

  b.pm X

it works fine. But when I use it as a module, say
from this context:

===================== This is file p.pl
#!/usr/local/bin/perl -w
use strict;
use b;
b::f('X');
=================================

when executing

  p.pl

I get the warning

  Name "main::DATA" used only once: possible typo at b.pm line 10.

How can I get rid of this warning? I can't use "use vars" here to
"predeclare"
main::DATA, because it is a file handle.

Ronald



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

Date: Wed, 29 Nov 2006 11:43:06 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How do I get rid of this warning?
Message-Id: <r1nqm2h89ma6t70p3t2lqc7cnnrmjs0b9q@4ax.com>

On 29 Nov 2006 00:13:22 -0800, "Ronny" <ro.naldfi.scher@gmail.com>
wrote:

>==================== This is file b.pm
>#!/usr/local/bin/perl -w
>use strict;

BTW:

  use warnings;  # it's better nowadays

(And I would be surprised if the shebang line did matter in .pm files,
unless of course you're also using them as scripts.)

>package b;

This is probably a minimal example, but do not use lowercase only
names for packages, as those are reserved for pragmas. BTW: do not use
B, since it does actually exist.

>sub f { print "BBBBBBBB @_\n"; }
>eval join('', <main::DATA>) || die $@ unless caller();
>1
>__END__
>package main;
>b::f(@ARGV);

Huh?!? Smell of XY problem here?
(<http://perlmonks.org/?node=XY+problem>)

What's wrong with

  f(@ARGV) unless caller;

?


>it works fine. But when I use it as a module, say
>from this context:
>
>===================== This is file p.pl
>#!/usr/local/bin/perl -w
>use strict;
>use b;
>b::f('X');
>=================================
>
>when executing
>
>  p.pl
>
>I get the warning
>
>  Name "main::DATA" used only once: possible typo at b.pm line 10.

  #!/usr/bin/perl
  
  use strict;
  use warnings;
  
  use lib sub {
      pop eq 'BB.pm' ?
        do { open my $fh, '<', \<<'.EOM' or die "$!\n";
  # -----------------
  use strict;
  use warnings;
  package BB;
  local $/;
  print <DATA>;
  print <main::DATA>;
  1;
  __DATA__
  BB::whatever...
  .EOM
  # -----------------
              $fh } : undef
  };
  
  use BB;
  
  __DATA__
  main::whatever...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Wed, 29 Nov 2006 01:46:36 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: line breaks
Message-Id: <m2odqqiwc3.fsf@Sherm-Pendleys-Computer.local>

gcr <reviewyourdemo@hotmail.com> writes:

> Sure didn't want to start off a flamewar when my original problem was 
> purely idiocy and crossed eyes. Guess I'll stay off this NG

You shouldn't confuse ignorance with idiocy. You may be afflicted with the
first condition, but unlike the second it's curable - but not if you insist
on refusing education.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Wed, 29 Nov 2006 05:42:10 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Nov 29 2006
Message-Id: <J9H96A.HKq@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.

Class-DBI-Cascade-Nullify-0.01
http://search.cpan.org/~danny/Class-DBI-Cascade-Nullify-0.01/
Nullify any related Class::DBI objects
----
Class-DBI-Cascade-Nullify-0.02
http://search.cpan.org/~danny/Class-DBI-Cascade-Nullify-0.02/
Nullify any related Class::DBI objects
----
Class-DBI-Cascade-Plugin-Nullify-0.01
http://search.cpan.org/~danny/Class-DBI-Cascade-Plugin-Nullify-0.01/
Nullify any related Class::DBI objects
----
Class-DBI-Cascade-Plugin-Nullify-0.02
http://search.cpan.org/~danny/Class-DBI-Cascade-Plugin-Nullify-0.02/
Nullify any related Class::DBI objects
----
Combine-3.4.4
http://search.cpan.org/~aardo/Combine-3.4.4/
----
Crypt-PBC-0.4.2-0.7.15
http://search.cpan.org/~jettero/Crypt-PBC-0.4.2-0.7.15/
OO interface for Lynn's PBC library @ Standford
----
DateTime-Format-Natural-0.21
http://search.cpan.org/~schubiger/DateTime-Format-Natural-0.21/
Create machine readable date/time with natural parsing logic
----
Device-SerialPort-Xmodem-1.03
http://search.cpan.org/~mitti/Device-SerialPort-Xmodem-1.03/
Xmodem file transfer protocol for Device::SerialPort
----
File-Find-Object-0.0.6
http://search.cpan.org/~shlomif/File-Find-Object-0.0.6/
An object oriented File::Find replacement
----
Games-RolePlay-MapGen-0.29.1
http://search.cpan.org/~jettero/Games-RolePlay-MapGen-0.29.1/
The base object for generating dungeons and maps
----
HTML-ResolveLink-0.05
http://search.cpan.org/~miyagawa/HTML-ResolveLink-0.05/
Resolve relative links in (X)HTML into absolute URI
----
HTML-Template-Compiled-0.83
http://search.cpan.org/~tinita/HTML-Template-Compiled-0.83/
Template System Compiles HTML::Template files to Perl code
----
HTML-Template-Compiled-Plugin-HTML_Tags-0.03
http://search.cpan.org/~tinita/HTML-Template-Compiled-Plugin-HTML_Tags-0.03/
HTC-Plugin for various HTML tags
----
Kwalify-1.09
http://search.cpan.org/~srezic/Kwalify-1.09/
Kwalify schema for data structures
----
Kwalify-1.10
http://search.cpan.org/~srezic/Kwalify-1.10/
Kwalify schema for data structures
----
Lingua-JA-Regular-0.09
http://search.cpan.org/~takefumi/Lingua-JA-Regular-0.09/
Regularize of the Japanese character.
----
Net-IRC3-0.4
http://search.cpan.org/~elmex/Net-IRC3-0.4/
An event system independend IRC protocol module
----
Net-Z3950-ZOOM-1.14
http://search.cpan.org/~mirk/Net-Z3950-ZOOM-1.14/
Perl extension for invoking the ZOOM-C API.
----
POE-Component-Client-NNTP-1.05
http://search.cpan.org/~bingos/POE-Component-Client-NNTP-1.05/
A component that provides access to NNTP.
----
POE-Component-OSCAR-0.04
http://search.cpan.org/~dmcc/POE-Component-OSCAR-0.04/
A POE Component for the Net::OSCAR module
----
PerlInterp-0.05
http://search.cpan.org/~bmorrow/PerlInterp-0.05/
----
Redland-1.0.5.2
http://search.cpan.org/~djbeckett/Redland-1.0.5.2/
Redland RDF Class
----
Router-Statistics-0.91_1
http://search.cpan.org/~shamrock/Router-Statistics-0.91_1/
Router Statistics and Information Collection
----
Template-Plugin-EnvHash-1.04
http://search.cpan.org/~srshah/Template-Plugin-EnvHash-1.04/
Environment Variable Hash for TT2
----
WWW-StreetMap-0.13
http://search.cpan.org/~srshah/WWW-StreetMap-0.13/
Interface to http://www.streetmap.co.uk/
----
WWW-Translate-interNOSTRUM-0.07
http://search.cpan.org/~enell/WWW-Translate-interNOSTRUM-0.07/
Catalan < > Spanish machine translation
----
Win32-API-0.43
http://search.cpan.org/~cosimo/Win32-API-0.43/
Perl Win32 API Import Facility
----
Win32-API-0.44
http://search.cpan.org/~cosimo/Win32-API-0.44/
Perl Win32 API Import Facility
----
go-perl-0.06
http://search.cpan.org/~cmungall/go-perl-0.06/
----
threads-1.53
http://search.cpan.org/~jdhedden/threads-1.53/
Perl interpreter-based threads


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: Wed, 29 Nov 2006 02:44:41 -0500
From: gcr <reviewyourdemo@hotmail.com>
Subject: NRN again
Message-Id: <reviewyourdemo-089898.02444129112006@reader2.panix.com>

> but not if you insist on refusing education.

Give it a rest, newsgroup cop. You made up an argument and you won. I 
will now email a couple of people and rewrite their scripts with CGI.pm 
;-> Fix it even if it works. timtowtdi
Thanks for pointing out the original typo, though. That was *cool*.


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

Date: Wed, 29 Nov 2006 02:40:38 -0500
From: gcr <reviewyourdemo@hotmail.com>
Subject: NRN
Message-Id: <reviewyourdemo-8EF6D5.02403829112006@reader2.panix.com>

> Claim what you will, you've demonstrated otherwise in your messages here.

Uh ... no.

>> No worries. See one of the parent responses with some cool, IMHO, 
code.

> That, in a nutshell, is your problem. You value "cool" over knowledge.

You have a problem with that guys code? If so, it's above my head. 
You've revealed yourself as a weirdo. I don't doupt your command of 
perl, I do doupt your social skills.


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

Date: Wed, 29 Nov 2006 10:10:06 +0100
From: Ric <antispam@randometry.com>
Subject: Re: Perl/Mail Suggestion....
Message-Id: <ekjisj$poo$1@online.de>


> 
> Hmm...tried your suggestion, here is the output:
> 
> [root@nytelife scripts]# telnet mail.chicagorsvp.com 25
> Trying 206.126.253.242...
> telnet: connect to address 206.126.253.242: Connection refused

and 206.126.253.242 is the ip of your new mailserver?
> 
> And, I have IPTABLES running, but I've enabled ports 110 & 25:
> 
> ACCEPT     tcp  --  anywhere             anywhere            state NEW
> tcp dpt:smtp
> ACCEPT     tcp  --  anywhere             anywhere            state NEW
> tcp dpt:pop3
> 
> Any suggestions?  This is weird as I copied config files from a working
> server.....

well that may be the problem, depending on what you copied and depending
on your network setup:-)
> 

Without knowing your whole network setup this is difficult to check if
everything is okay, you may need forwarding rules etc.

Just run the telnet commands I told you earlier on your new mailserver
(mail.chicagorsvp.com)

on that machine in a konsole:

telnet localhost 25

If that works you know this machine is okay and you have a
network/firewal problem.

But this is definitely not the appropriate mailinglist for your problem.




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

Date: 29 Nov 2006 11:00:47 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: regex matching exactly 10 digits
Message-Id: <slrnemqq1q.c8.abigail@alexandra.abigail.be>

jtbutler78@comcast.net (jtbutler78@comcast.net) wrote on MMMMDCCCXXXVII
September MCMXCIII in <URL:news:1164722289.747483.230390@n67g2000cwd.googlegroups.com>:
;;  I am having an issue trying to match exactly 10 digits.  I want to
;;  append a '1' in front of 10 digit fax numbers.  Numbers longer than 10
;;  digits leave alone.  I am using \d{10,10} match at least and at most 10
;;  digits but it still appends a 1 to international numbers.  I am missing
;;  something but I am not sure what.
;;  
;;  #strip out unneeded chars
;;  $fax_num =~ s/[\s()-]//g;
;;  
;;  #append 1 to 10 digit fax number
;;  $fax_num =~ s/(\d{10,10})/1$1/;


This prepends 1 whenever it sees 10 digits. A string consisting of 11
digits will also contain a string of 10.

I'd do something like:

    $fax_num =~ s/(?<!\d)(\d{10})(?!\d)/1$1/;


Abigail
-- 
BEGIN {my $x = "Knuth heals rare project\n";
       $^H {integer} = sub {my $y = shift; $_ = substr $x => $y & 0x1F, 1;
       $y > 32 ? uc : lc}; $^H = hex join "" => 2, 1, 1, 0, 0}
print 52,2,10,23,16,8,1,19,3,6,15,12,5,49,21,14,9,11,36,13,22,32,7,18,24;


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

Date: Wed, 29 Nov 2006 01:40:38 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: relax
Message-Id: <m2slg2iwm1.fsf@Sherm-Pendleys-Computer.local>

gcr <reviewyourdemo@hotmail.com> writes:

>> Let me get this straight - you don't know what a global is, you don't know
>> what it means to return a value from a subroutine,
>
> Uh I've been very good at staying out of flamewars over the years so I 
> won't respond except to say incorrect  - I do know what global is and 
> I've written my own subroutines in Perl and C.

Claim what you will, you've demonstrated otherwise in your messages here.

> No worries. See one of the parent responses with some cool, IMHO, code.

That, in a nutshell, is your problem. You value "cool" over knowledge.

Oh well, that's your loss - not mine.

*plonk*

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Wed, 29 Nov 2006 09:16:20 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: relax
Message-Id: <fcgqm2p0doclsf4l1kn9o4iu1b3j5thelq@4ax.com>

On Tue, 28 Nov 2006 23:59:57 -0500, gcr <reviewyourdemo@hotmail.com>
wrote:

>> Let me get this straight - you don't know what a global is, you don't know
>> what it means to return a value from a subroutine,
>
>Uh I've been very good at staying out of flamewars over the years so I 
>won't respond except to say incorrect  - I do know what global is and 
>I've written my own subroutines in Perl and C. Some of them have been 
>running on the interweb bug free for a while now.
>
>> call code that uses CGI.pm "broken"
>
>No. You're reading what you want to read. By taking cgi.pm out of 
>someone elses code and replacing it with my incompetance the code worked.
>His problem was solved.

It's CGI.pm, case *does* matter. This rings a bell...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Wed, 29 Nov 2006 09:13:04 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: rewrite
Message-Id: <t6gqm25rclhm84unlv0al2c6q6akcko2af@4ax.com>

On Tue, 28 Nov 2006 23:48:09 -0500, gcr <reviewyourdemo@hotmail.com>
wrote:

>Hey this is cool! Expecially
> map { s/%(..)/chr(hex $1)/eg; $_ } split /=/, $_, 2;

Yes, so what? Is this supposed to be a followup to something else?


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Wed, 29 Nov 2006 09:13:47 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: rewrite
Message-Id: <q8gqm2hg180n14r9m6q9267m0uefm09lvc@4ax.com>

On Tue, 28 Nov 2006 23:48:09 -0500, gcr <reviewyourdemo@hotmail.com>
wrote:

>Subject: rewrite

Oh, and I forgot: *please* put the subject of your posts in the
Subject.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Wed, 29 Nov 2006 12:23:37 +0530
From: "rajendra" <rajendra.prasad@in.bosch.com>
Subject: sharing a  variable across two scripts.
Message-Id: <ekjafb$7h2$1@news4.fe.internet.bosch.com>

Hello All,

I have two scripts A and B .Script A  calls script B for getting data. This
data is used by script A for processing. Is there a concept of shared
variable so that data stored in this shared variable can be accessed by
script A.


With Rgds,
Raj




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

Date: Wed, 29 Nov 2006 01:59:49 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: sharing a  variable across two scripts.
Message-Id: <m2k61eivq2.fsf@Sherm-Pendleys-Computer.local>

"rajendra" <rajendra.prasad@in.bosch.com> writes:

> I have two scripts A and B .Script A  calls script B for getting data. This
> data is used by script A for processing. Is there a concept of shared
> variable so that data stored in this shared variable can be accessed by
> script A.

Yes - Perl calls it a "module". Modules can share data, subroutines, or both
with the program that loads them.

Have a look at "perldoc perlmod" for more.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Wed, 29 Nov 2006 13:46:06 +0530
From: "rajendra" <rajendra.prasad@in.bosch.com>
Subject: Re: sharing a  variable across two scripts.
Message-Id: <ekjfa2$co9$1@news4.fe.internet.bosch.com>

Hello ,
Thanks for the reply.
To be more specific, I would like to know whether a perl variable(may be a
variable or array or a hash) which can be shared across two different batch
files.

With Rgds,
Raj

"Sherm Pendley" <spamtrap@dot-app.org> wrote in message
news:m2k61eivq2.fsf@Sherm-Pendleys-Computer.local...
> "rajendra" <rajendra.prasad@in.bosch.com> writes:
>
> > I have two scripts A and B .Script A  calls script B for getting data.
This
> > data is used by script A for processing. Is there a concept of shared
> > variable so that data stored in this shared variable can be accessed by
> > script A.
>
> Yes - Perl calls it a "module". Modules can share data, subroutines, or
both
> with the program that loads them.
>
> Have a look at "perldoc perlmod" for more.
>
> sherm--
>
> -- 
> Web Hosting by West Virginians, for West Virginians: http://wv-www.net
> Cocoa programming in Perl: http://camelbones.sourceforge.net




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

Date: Wed, 29 Nov 2006 03:33:25 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: sharing a  variable across two scripts.
Message-Id: <m23b82ire2.fsf@Sherm-Pendleys-Computer.local>

"rajendra" <rajendra.prasad@in.bosch.com> writes:

> "Sherm Pendley" <spamtrap@dot-app.org> wrote in message
> news:m2k61eivq2.fsf@Sherm-Pendleys-Computer.local...
>> "rajendra" <rajendra.prasad@in.bosch.com> writes:
>>
>> > I have two scripts A and B .Script A  calls script B for getting data.
> This
>> > data is used by script A for processing. Is there a concept of shared
>> > variable so that data stored in this shared variable can be accessed by
>> > script A.
>>
>> Yes - Perl calls it a "module". Modules can share data, subroutines, or
> both
>> with the program that loads them.
>>
>> Have a look at "perldoc perlmod" for more.
>
> Hello ,
> Thanks for the reply.
> To be more specific, I would like to know whether a perl variable(may be a
> variable or array or a hash) which can be shared across two different batch
> files.

Does script B ever need to be run by itself? If not, it might be better off
as a module instead of as a script. That's why I referred you to perlmod.
Modules have a standard mechanism for exporting aliases for their symbols
into the caller's package.

If B needs to be a standalone script, you might have a look at do() - see
"perldoc -f do".

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Wed, 29 Nov 2006 09:08:47 +0100
From: "Tutico" <moreno@tututico.it>
Subject: Something likes crontab on Unix.
Message-Id: <ekjf6l$dcn$1@ss408.t-com.hr>

Please help me!

How to make Perl program that run it every 10 minutes and don't visibly slow
down Windows based PC. Something likes crontab on Unix.

Thanks




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

Date: Wed, 29 Nov 2006 03:21:06 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Something likes crontab on Unix.
Message-Id: <m27ixeiryl.fsf@Sherm-Pendleys-Computer.local>

"Tutico" <moreno@tututico.it> writes:

> How to make Perl program that run it every 10 minutes and don't visibly slow
> down Windows based PC. Something likes crontab on Unix.

Have a look at CRONw - CRON for Windows.

     <http://cronw.sourceforge.net/>

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


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

Date: Wed, 29 Nov 2006 10:51:11 +0100
From: Ric <antispam@randometry.com>
Subject: Re: Something likes crontab on Unix.
Message-Id: <ekjl9k$td9$1@online.de>

Tutico schrieb:
> Please help me!
> 
> How to make Perl program that run it every 10 minutes and don't visibly slow
> down Windows based PC. Something likes crontab on Unix.
> 
> Thanks
> 
> 

Maybe you should try to explain a little better what you are up to. I'm
not exactly sure what you have in mind.

Windows has sheduled tasks, see:

http://www.iopus.com/guides/winscheduler.htm

Is that okay what you need or do you need to start a perl programm, that
sleeps for 10 minutes does processing and sleeps again for 10 min?


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

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 10018
****************************************


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