[19847] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2042 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 31 14:06:07 2001

Date: Wed, 31 Oct 2001 11:05:14 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1004555114-v10-i2042@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 31 Oct 2001     Volume: 10 Number: 2042

Today's topics:
        ``inheritance" of use locale <usenet@diefenba.ch>
    Re: Any good free syntax coloring editors for Perl on W (Neil Kandalgaonkar)
    Re: Contents of a hash blank in only *part* of a module (Tad McClellan)
    Re: Contents of a hash blank in only *part* of a module <jason@uklinux.net>
    Re: Design questions about fork(), pipe() and sockets (Rocco Caputo)
        Domain www.naturalborndeveloper.com for sale. (Phillip Lockwood-Holmes)
        Example form perl documentation doesn't work (winter7)
    Re: FTP,Mail Modules for ActivePerl (Charles DeRykus)
        Getting one element of array return value (Dimitri)
    Re: Getting one element of array return value (Clinton A. Pierce)
    Re: Getting one element of array return value <wuerz@yahoo.com>
    Re: Getting one element of array return value <jasper@guideguide.com>
    Re: Getting one element of array return value (Tad McClellan)
    Re: Getting one element of array return value <wuerz@yahoo.com>
    Re: Getting one element of array return value <mjcarman@home.com>
    Re: Getting one element of array return value (Tad McClellan)
    Re: Getting one element of array return value <joe+usenet@sunstarsys.com>
    Re: Getting one element of array return value <jasper@guideguide.com>
        How to pass scalar to Module <jkumar@atrenta.com>
        How to run a perl script as background from remote host <j0eblack@ihug.com.au>
    Re: How to run a perl script as background from remote  <achatz@forthnet.gr>
    Re: How to run a perl script as background from remote  <eod_spam@yahoo.es>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 31 Oct 2001 22:08:41 +0100
From: Kai Diefenbach <usenet@diefenba.ch>
Subject: ``inheritance" of use locale
Message-Id: <ixy9lrbjqe.fsf@diefenba.ch>

Hi,

I intend to write a package which is using locale; in dependence use 
locale from the calling skript/module;

please consider following:
(hope it's okay to use german umlauts for this example)

#!/usr/local/perl -w 
use strict;

use locale;
use Local;

print 'main: ', sort(qw(a b c ä)), "\n";

# --- Local.pm
package Local;
use strict;

print 'Lokal.pm: ', sort(qw(a b c ä)), "\n";
1;

results of course in:
Local.pm: a b c ä
main: a ä b c

my final solution, i just add 

BEGIN {if ($::{'locale::'}) { $^H |= 0x800 } }

to Local.pm and I get the whished result :-)
Local.pm: a ä b c
main: a ä b c

so far so good but not merely due to the warning in perlvar: ``$^H is strictly 
for internal use", I tried the maybe more obviously

BEGIN { if ($::{'locale::'}) { require locale; import locale} }

Now i've to note that the if is always true even when the calling script don't 
use locale;

Now my questions are: 
do anyone know a better way than the first one?
do anyone have a suggestion why the if is always true,
maybe this results in a better way :-) ?

TIA, Kai



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

Date: 31 Oct 2001 06:38:56 -0800
From: neilk@activestate.com (Neil Kandalgaonkar)
Subject: Re: Any good free syntax coloring editors for Perl on Windows?
Message-Id: <569a56af.0110310638.71d4d7ac@posting.google.com>

Louis Erickson <wwonko@rdwarf.com> wrote in message news:<9ri785$6tc$1@holly.rdwarf.com>...
> Syamala Tadigadapa <syamalarao_tadigadapa@yahoo.com> wrote:
> 
> : Can some body send me pointers to some really good syntax coloring editors on
> : Windows platform
> : for Perl.

> I'll be happy to reccomend Komodo from ActiveState.  It supports Perl
> and Python and I think some others now, and seems pretty good.  It's
> gotten a little tricky to find on their web site, but look here:
> 
> http://aspn.activestate.com/ASPN/Downloads/Komodo/More

We've revamped the site a bit... try:
  
   <http://ActiveState.com/Komodo/>

On the topic of Windows Perl IDEs, our Visual Perl IDE for 
Microsoft Visual Studio.NET is now at version 1.1. That URL again 
is...

   <http://ActiveState.com/Visual_Perl/>

(Posting via google since my ISP has already retired this message.)

--
Neil Kandalgaonkar
neilk@ActiveState.com


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

Date: Wed, 31 Oct 2001 14:07:24 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Contents of a hash blank in only *part* of a module
Message-Id: <slrn9tvubn.2q2.tadmc@tadmc26.august.net>

Jason Clifford <jason@uklinux.net> wrote:
>
>I have a module to which I am passing some data in the form of a scalar
>and a reference to a hash 

>My problem is that the returned string contains all of the information it
>should *except* for the data that was in the hash.
>
>At first I thought perhaps the hash data was not being properly received
>however I checked that by dumping it out to a file from inside the module
>just before it gets used properly and the data is all there.
>
>Below is the relevant section of code:
              ^^^^^^^^^^^^^^^^

I'm pretty sure that the relevant section of code is not
what you have included below. It works fine for me.


>open (DUMP, "> user_dat.file") || die "unable to open user_dat.file";


You should include the $! variable in your diagnostic message,
it will tell you _why_ the open() failed.


>my $jasonvar = "name=".$user_dat->{'name'};

You could interpolate rather than concatenate. Most people think
interpolation is easier to read and understand.


>Immediately following on from this however when I try to use the hash
>below all I get is blank.

[snip]

>Can anyone shed any light on this for me?


You should consider posting a short and complete program that
we can run. Like this:

--------------------------
#!/usr/bin/perl
use warnings;
use strict;

print do_something( { name => 'Jason' } );

sub do_something {
   my($user_dat) = @_;

   my $jasonvar = "name=$user_dat->{name}";
   print "$jasonvar\n-----\n";

   my $basket_data = <<EOBD;
Content-type: text/html

##START##
cname=GBP
name=$user_dat->{'name'}
EOBD

   return $basket_data;
}
--------------------------


Seems to work. There is something going on that you haven't shown us...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 31 Oct 2001 15:16:01 +0000
From: Jason Clifford <jason@uklinux.net>
Subject: Re: Contents of a hash blank in only *part* of a module
Message-Id: <Pine.LNX.4.30.0110311510580.25169-100000@s1.uklinux.net>

On Wed, 31 Oct 2001, Tad McClellan wrote:

> I'm pretty sure that the relevant section of code is not
> what you have included below. It works fine for me.

Mea cupla! After reading your message I had a moment of inspiration and
decided to double check the database contents. I was not entirely
surprised to find two records in the database for each "unique" entry with
the first one not having the details I was missing.

Digging further into the code I discovered an earlier call to the relevant
routine that lacked all the necessary parameters.

My only defence is that the code is not mine. It's a shopping basket
written by someone else and while an earlier version is working properly
for one site this new version has a different design and obviously is not
as well written.

I'll have words with the author this afternoon.

> >open (DUMP, "> user_dat.file") || die "unable to open user_dat.file";

> You should include the $! variable in your diagnostic message,
> it will tell you _why_ the open() failed.

When it matters I do. In this case I knew that the file open would succeed
as I had already placed the file there with the permissions set correctly.
I would have left the check off entirely except that it's pretty much
automatic to put one in.

> Seems to work. There is something going on that you haven't shown us...

Indeed you were right. I've got it sussed now however but thanks for your
help anyway.

Jason Clifford



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

Date: 31 Oct 2001 18:50:07 GMT
From: troc@netrus.net (Rocco Caputo)
Subject: Re: Design questions about fork(), pipe() and sockets
Message-Id: <slrn9u0hur.11i.troc@eyrie.homenet>

On Wed, 31 Oct 2001 09:30:02 +0100, Edwin Günthner <edgue@web.de> wrote:
>
>At least the latest version wont run (it needs Time::HiRes, and
>Time::HiRes wont work on OS/2).
>
>I will see if the other alternatives might work.

Time::HiRes worked on OS/2 earlier this year.  Any incompatibility is
a recent development, so to speak, and you probably are in a great
position to fix that.  Please consider patching Time::HiRes and
submitting your changes so that the OS/2 community can benefit.

-- Rocco Caputo / troc@netrus.net / poe.perl.org / poe.sourceforge.net


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

Date: 31 Oct 2001 06:17:28 -0800
From: nbd@starmail.com (Phillip Lockwood-Holmes)
Subject: Domain www.naturalborndeveloper.com for sale.
Message-Id: <b01db62c.0110310617.60b355a4@posting.google.com>

The perfect domain for any Perl developer - domain
www.naturalborndeveloper.com is now up for sale. I've used this domain
to show my portfolio and it looks brilliant on a resume. I now have a
great job and thought someone else might want to use it.

Send your offers to nbd@starmail.com and be creative. We don't really
need the money so think old computers / services / share of revenue /
free to someone with a good idea.

Phillip Lockwood-Holmes


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

Date: 31 Oct 2001 09:49:57 -0800
From: winter7@e-mailanywhere.com (winter7)
Subject: Example form perl documentation doesn't work
Message-Id: <fb7341b.0110310949.1cab46a6@posting.google.com>

This is example from "perl Interprocess Communication" from perl site.
When I run this server program, and I telnet to this server with
address of my ip-address and port 9000, I get this error: Can't call
method "name" on an
                                            undefined value
But it works find if I give "localhost" as address instead of
ip-address.
What was wrong?

Thanks..


---------------------------------------------------------------------
#!/usr/bin/perl -w
 use IO::Socket;
 use Net::hostent;		# for OO version of gethostbyaddr

 $PORT = 9000;			# pick something not in use

 $server = IO::Socket::INET->new( Proto     => 'tcp',
                                  LocalPort => $PORT,
                                  Listen    => SOMAXCONN,
                                  Reuse     => 1);

 die "can't setup server" unless $server;
 print "[Server $0 accepting clients]\n";

 while ($client = $server->accept()) {
   $client->autoflush(1);
   print $client "Welcome to $0; type help for command list.\n";
   $hostinfo = gethostbyaddr($client->peeraddr);
   printf "[Connect from %s]\n", $hostinfo->name || $client->peerhost;
   print $client "Command? ";
   while ( <$client>) {
     next unless /\S/;	     # blank line
     if    (/quit|exit/i)    { last;                                  
  }
     elsif (/date|time/i)    { printf $client "%s\n", scalar
localtime;  }
     elsif (/who/i )         { print  $client `who 2>&1`;             
  }
     elsif (/cookie/i )      { print  $client `/usr/games/fortune
2>&1`; }
     elsif (/motd/i )        { print  $client `cat /etc/motd 2>&1`;   
  }
     else {
       print $client "Commands: quit date who cookie motd\n";
     }
   } continue {
      print $client "Command? ";
   }
   close $client;
 }


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

Date: Wed, 31 Oct 2001 17:30:52 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: FTP,Mail Modules for ActivePerl
Message-Id: <GM2zBG.Br1@news.boeing.com>

In article <b7btttserb4l80r8652jiqeku0i3ttcooo@4ax.com>,
Bart Lateur  <bart.lateur@skynet.be> wrote:
>Ferry Bolhar wrote:
>
>>I'm looking for modules like Mail::Mailer and Net::FTP, to use on NT4
>>systems with Active Perl. Seems that these modules are not distributed with
>>ActivePerl. I also looked at CPAN but didn't find them.
>
>	<http://www.activestate.com/PPMpackages/5.6/>
>
>Mail::Mailer is in MailTools. As for Net::FTP... I'd expect to find it
>in libnet. It's not in the above directory... Hmm... I've got it, it
>appears to come with IndigoPerl.
>
>Well, this looks like it's an ordinary perl module, so you should be
>able to use it straight from CPAN:
>	
>	<http://search.cpan.org/search?dist=libnet>

I believe ActiveState's binary comes pre-installed with a 
number of modules (libnet,libwww-perl, XML-Parser,...) 
needed for PPM. 

--
Charles DeRykus


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

Date: 31 Oct 2001 07:59:46 -0800
From: mauroid@csi.forth.gr (Dimitri)
Subject: Getting one element of array return value
Message-Id: <a3ebf7b8.0110310759.682bed00@posting.google.com>

Say we have a subroutine that returns an array (a big one). How can
I get the n-th element of this array, without having to assign the
return value to another array (and effectively copy the whole thing)?

This doesn't work :

sub sss { (1, 2, 3); }

$x = ${&sss()}[1];	## $x is undef

$x = &sss()[1];		## syntax error

The subroutine sss was NOT written by me, so I cannot modify it (and
have it return an array pointer for instance).

Thanks for any help,
Dimitri


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

Date: Wed, 31 Oct 2001 16:17:13 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Getting one element of array return value
Message-Id: <3be022bb.90615408@localhost>

On 31 Oct 2001 07:59:46 -0800, mauroid@csi.forth.gr (Dimitri) wrote:

>Say we have a subroutine that returns an array (a big one). How can
>I get the n-th element of this array, without having to assign the
>return value to another array (and effectively copy the whole thing)?
>
>This doesn't work :
>
>sub sss { (1, 2, 3); }
>

$element = (sss(args...)([1];



-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours  *and*
  clintp@geeksalad.org         Perl Developer's Dictionary 
"If you rush a Miracle Man,     for details, see http://geeksalad.org
        you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: 31 Oct 2001 11:17:52 -0500
From: Mona Wuerz <wuerz@yahoo.com>
Subject: Re: Getting one element of array return value
Message-Id: <m34rofyea7.fsf@DCCMBX01.njitdm.campus.njit.edu>

mauroid@csi.forth.gr (Dimitri) writes:

> Say we have a subroutine that returns an array (a big one).

There's the problem. Subroutines don't return arrays, they return
lists. See the third item in perldoc -q list for an explanation. So
there's no way (as far as I can see) to avoid assigning that list to
an array variable if you want to address specific elements.

-mona


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

Date: Wed, 31 Oct 2001 16:22:46 +0000
From: Jasper McCrea <jasper@guideguide.com>
Subject: Re: Getting one element of array return value
Message-Id: <3BE02556.57AF0740@guideguide.com>

Dimitri wrote:
> 
> Say we have a subroutine that returns an array (a big one). How can
> I get the n-th element of this array, without having to assign the
> return value to another array (and effectively copy the whole thing)?
> 
> This doesn't work :
> 
> sub sss { (1, 2, 3); }
> 
> $x = ${&sss()}[1];      ## $x is undef
> 
> $x = &sss()[1];         ## syntax error
> 

I think Clinton mis-typed, and Mona is incorrect

$x = (sss())[1];

Jasper
-- 
@a=0..63;g(o($_),a($_)?$_<24?"w":$_>39?"b":0:0)for@a;$w=$b=12;while($w||$b){$z=
!$z;$i="
01234567\n";print$i,(join"",map{($x,$y)=o($_);($x?"":$y).(a($_)?
`tput smso`:`tput rmso`).(g(o($_))||" ").`tput
rmso`.($x==7?"$y\n":"")}@a),$i;$
z?n(""):c();g($f,$g,($g==7&&$z)||(!$z&&!$g)?uc
w():g($d,$e));g($d,$e,0);t(1)
}sub n{print"\n$_[0]go
xyxy\n";($d,$e,$f,$g)=split"",<STDIN>;v()||n("nfg-")}sub
t{@t=($f>$d?$d+1:$d-1,$g>$e?$e+1:$e-1);if($s==4&&g(@t)&&lc(g(@t))ne
w()){if(
shift){g(@t,0);$z?--$b:--$w}1}else{0}}sub
v{$s=($d-$f)**2;(lc(g($d,$e))ne w()||
$s!=($e-$g)**2||g($f,$g)||($f>7||$f<0)||($g>7||$g<0)||(($z?$e-$g:$g-$e)>0)&&!(g
($d,$e)eq uc w())||!($s==1||t()))?0:1}sub
c{for(sort{rand}@a){($d,$e)=o($_);
next if lc(g(o($_)))ne w();for(@a){($f,$g)=o($_);next if!v();return 1 if
t();
push@q,[$d,$e,$f,$g]}}($d,$e,$f,$g)=@{$q[0]}or die"win\n"}sub
w{$z?"w":"b"}sub
o{($_[0]%8,int($_[0]/8))}sub a{(($_[0]%8)+(int($_[0]/8)))%2}sub
g{$n=$_[0]+8*$_
[1];defined$_[2]?$position[$n]=$_[2]:$position[$n]}die$w?"win":"lose"."\n"


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

Date: Wed, 31 Oct 2001 16:22:53 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Getting one element of array return value
Message-Id: <slrn9u06kk.3nt.tadmc@tadmc26.august.net>

Dimitri <mauroid@csi.forth.gr> wrote:

>Say we have a subroutine that returns an array (a big one). 


That would be a trick, as it is impossible to return an array in Perl :-)

I expect you meant to say that it returns a list.

From the Perl FAQ:

   "What is the difference between a list and an array?"


>How can
>I get the n-th element of this array, without having to assign the
>return value to another array (and effectively copy the whole thing)?


You can use a "list slice" to slice a list. See the "Slices" 
section in perldata.pod.


>This doesn't work :
>
>sub sss { (1, 2, 3); }
>
>$x = ${&sss()}[1];	## $x is undef
>
>$x = &sss()[1];		## syntax error


That last one is pretty close though:

   $x = (sss())[1];

I don't generally use ampersand on function calls, because I
don't generally want the special treatment for function args
that it invokes. See perlsub.pod.


>The subroutine sss was NOT written by me, 


OK, so we'll skip giving you a hard time about the silly
uncommunicative name it was given.  :-)


>so I cannot modify it (and
>have it return an array pointer for instance).


Well you're pretty much hosed then, as the big list is going
to go in memory one way or another, either on the stack (list slice)
or on the heap (copy to an array).


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 31 Oct 2001 11:44:41 -0500
From: Mona Wuerz <wuerz@yahoo.com>
Subject: Re: Getting one element of array return value
Message-Id: <m3zo67wyh2.fsf@DCCMBX01.njitdm.campus.njit.edu>

Jasper McCrea <jasper@guideguide.com> writes:

> Dimitri wrote:
> > 
> > Say we have a subroutine that returns an array (a big one). How can
> > I get the n-th element of this array, without having to assign the
> > return value to another array (and effectively copy the whole thing)?
> 
> I think Clinton mis-typed, and Mona is incorrect
> 
> $x = (sss())[1];

So that avenue doesn't

> > [...] effectively copy the whole thing)?

I assumed it did; is this incorrect?

-mona


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

Date: Wed, 31 Oct 2001 10:20:33 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: Getting one element of array return value
Message-Id: <3BE024D1.79D19AD3@home.com>

Dimitri wrote:
> 
> Say we have a subroutine that returns an array (a big one). How can
> I get the n-th element of this array, without having to assign the
> return value to another array (and effectively copy the whole thing)?
> 
> This doesn't work :
> 
> sub sss { (1, 2, 3); }
> 
> $x = ${&sss()}[1];      ## $x is undef
> 
> $x = &sss()[1];         ## syntax error

Make an anonymous list out of it:

$x = (sss())[1];

-mjc


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

Date: Wed, 31 Oct 2001 17:37:57 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Getting one element of array return value
Message-Id: <slrn9u0b1b.477.tadmc@tadmc26.august.net>

Michael Carman <mjcarman@home.com> wrote:

>Make an anonymous list out of it:

>$x = (sss())[1];


_All_ lists are anonymous.  :-)

That thingie above is a "list slice".


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 31 Oct 2001 13:02:38 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Getting one element of array return value
Message-Id: <m3n127n0w1.fsf@mumonkan.sunstarsys.com>

tadmc@augustmail.com (Tad McClellan) writes:

> Dimitri <mauroid@csi.forth.gr> wrote:
> 
> >Say we have a subroutine that returns an array (a big one). 
> 
> 
> That would be a trick, as it is impossible to return an array in Perl :-)
                                  ^^^^^^^^^^

Not any more :-)

  % perl -wle '@a=0..9; sub f:lvalue{@a} $#{\f}=3; print @a'
  0123

-- 
Joe Schaefer     "A cynic is a man who knows the price of everything and the
                                      value of nothing."
                                               --Oscar Wilde



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

Date: Wed, 31 Oct 2001 18:08:04 +0000
From: Jasper McCrea <jasper@guideguide.com>
Subject: Re: Getting one element of array return value
Message-Id: <3BE03E04.9C931C28@guideguide.com>

Mona Wuerz wrote:
> 
> Jasper McCrea <jasper@guideguide.com> writes:
> 
> > Dimitri wrote:
> > >
> > > Say we have a subroutine that returns an array (a big one). How can
> > > I get the n-th element of this array, without having to assign the
> > > return value to another array (and effectively copy the whole thing)?
> >
> > I think Clinton mis-typed, and Mona is incorrect
> >
> > $x = (sss())[1];
> 
> So that avenue doesn't
> 
> > > [...] effectively copy the whole thing)?
> 
> I assumed it did; is this incorrect?

Jeez, you might be right. I had assumed we just used this to access the
single element of the returned list? Does it, like you suggest, creat a
copy of the list? I hadn't really thought about it much until you said
that. It sounds pretty unlikely to me, but having looked at it for a few
minutes, I have decided I am probably wrong. Wouldn't be the first time.
(probably the second, or something :) )

Pause for discussion in't office...

One of my colleagues has come up with this:

perl -wle '@a = (1..3); (@a)=(3..5); print $a[1]'

which seems to show that there isn't a list copy of the array in this
case, but I have no idea how to test it with a list...

Jasper
-- 
@a=0..63;g(o($_),a($_)?$_<24?"w":$_>39?"b":0:0)for@a;$w=$b=12;while($w||
$b){$z=!$z;$i=" 01234567\n";print$i,(join"",map{($x,$y)=o($_);($x?"":$y)
 .(a($_)?`tput smso`:`tput rmso`).(g(o($_))||" ").`tput rmso`.($x==7?"$y
":"")}@a),$i;$z?n(""):c();g($f,$g,($g==7&&$z)||(!$z&&!$g)?uc w():g($d,$e
));g($d,$e,0);t(1)}sub n{print"\n$_[0]go xyxy\n";($d,$e,$f,$g)=split"",
<STDIN>;v()||n("nfg-")}sub t{@t=($f>$d?$d+1:$d-1,$g>$e?$e+1:$e-1);if($s
==4&&g(@t)&&lc(g(@t))ne w()){if(shift){g(@t,0);$z?--$b:--$w}1}else{0}}sub
v{$s=($d-$f)**2;(lc(g($d,$e))ne w()||$s!=($e-$g)**2||g($f,$g)||($f>7||$f
<0)||($g>7||$g<0)||(($z?$e-$g:$g-$e)>0)&&!(g($d,$e)eq uc w())||!($s==1||
t()))?0:1}sub c{for(sort{rand}@a){($d,$e)=o($_);next if lc(g(o($_)))ne w
();for(@a){($f,$g)=o($_);next if!v();return 1 if t();push@q,[$d,$e,$f,$g
]}}($d,$e,$f,$g)=@{$q[0]}or die"win\n"}sub w{$z?"w":"b"}sub o{($_[0]%8,
int($_[0]/8))}sub a{(($_[0]%8)+(int($_[0]/8)))%2}sub g{$n=$_[0]+8*$_[1];
defined$_[2]?$position[$n]=$_[2]:$position[$n]}die$w?"win":"lose"."\n"


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

Date: Wed, 31 Oct 2001 10:28:31 -0800
From: Jayakumar Mundunuri <jkumar@atrenta.com>
Subject: How to pass scalar to Module
Message-Id: <3BE042CF.EE83531B@atrenta.com>

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi Friends!
<p>Can you guys suggest me how can I pass a variable from a perl file to
its using module/package?
<br>Here is an example code for my problem :
<p>file : test.pl
<br>============
<br>my $scalar = "feature";
<br>require "sample.pl";
<br>&nbsp;
<p>file : sample.pl
<br>============
<br>use myPackage;
<br>some code......
<br>&nbsp;
<p>file: myPackage.pm
<br>================
<p>package myPackage;
<p>#&nbsp;I need to get $scalar value here from test.pl to proceed further
<p>some code ......
<br>&nbsp;
<p>It would be really helpful to me If anybody suggests me for my above
problem
<p>Thanks
<p>jay
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;</html>



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

Date: Thu, 1 Nov 2001 01:07:47 +1100
From: "j0eblack" <j0eblack@ihug.com.au>
Subject: How to run a perl script as background from remote host ?
Message-Id: <9rp0jl$a30$1@bugstomper.ihug.com.au>

Hi

I remotely connect to a server ** a paid hosting server ** ,  here's the
problem
I wanted to allow a script  to runs in background  ** the task of the script
is to constantly monitor certain directories  and delete the appropriate
file ** .
the problem is as soon as my telnet connection to the hosting server
terminated, the script stop running.
Is there any way I can let it keep running ? ** after the disconnection of
coz **
** probably this is not a so PERL question , but if u have a clue , greatly
appreciate it :) **

thank you







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

Date: Wed, 31 Oct 2001 17:03:56 +0200
From: Tassos Chatzithomaoglou <achatz@forthnet.gr>
To: j0eblack <j0eblack@ihug.com.au>
Subject: Re: How to run a perl script as background from remote host ?
Message-Id: <3BE012DC.FCA6C250@forthnet.gr>

Have a look at unix : cron or at commands should do the kob

j0eblack wrote:
> 
> Hi
> 
> I remotely connect to a server ** a paid hosting server ** ,  here's the
> problem
> I wanted to allow a script  to runs in background  ** the task of the script
> is to constantly monitor certain directories  and delete the appropriate
> file ** .
> the problem is as soon as my telnet connection to the hosting server
> terminated, the script stop running.
> Is there any way I can let it keep running ? ** after the disconnection of
> coz **
> ** probably this is not a so PERL question , but if u have a clue , greatly
> appreciate it :) **
> 
> thank you

-- 
***************************
Chatzithomaoglou Anastasios
 Network Operations Center
       FORTHnet S.A.
   <achatz@forthnet.gr>
***************************


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

Date: Wed, 31 Oct 2001 15:57:04 +0100
From: Eduardo Oliveros <eod_spam@yahoo.es>
To: j0eblack <j0eblack@ihug.com.au>
Subject: Re: How to run a perl script as background from remote host ?
Message-Id: <3BE01140.962343BA@yahoo.es>

you can try "nohup" in a UNIX OS

--edu

j0eblack wrote:

> Hi
>
> I remotely connect to a server ** a paid hosting server ** ,  here's the
> problem
> I wanted to allow a script  to runs in background  ** the task of the script
> is to constantly monitor certain directories  and delete the appropriate
> file ** .
> the problem is as soon as my telnet connection to the hosting server
> terminated, the script stop running.
> Is there any way I can let it keep running ? ** after the disconnection of
> coz **
> ** probably this is not a so PERL question , but if u have a clue , greatly
> appreciate it :) **
>
> thank you



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

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


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