[16814] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4226 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 5 11:05:39 2000

Date: Tue, 5 Sep 2000 08:05:22 -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: <968166321-v9-i4226@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 5 Sep 2000     Volume: 9 Number: 4226

Today's topics:
    Re: "list" vs "array" (was: @_ as array) nobull@mail.com
    Re: ASCII code (David de Gruyl)
    Re: ASCII code nobull@mail.com
        CGI retrieve file and save <Phil@moonhead.org.uk>
    Re: CGI retrieve file and save <foo@bar.va>
    Re: Compiling Perl for Teminal behavior nobull@mail.com
        dates Calculations <19wlr@globalnet.co.uk>
        dmake of PERL-5.6.0 using MSVC60 compiler gens error C2 <rydz@erols.com>
        Getting some Infos about Servers <Christian.Oehring@de.bosch.com>
    Re: How to copy directory tree <randy@theoryx5.uwinnipeg.ca>
    Re: How to make eval() secure with backtick? (Mark-Jason Dominus)
    Re: HTML::Mason as a templating tool. <philipg@atl.mediaone.net>
    Re: IPC::Shareable "Munged shared memory segment" error <steven@ircnet.dk>
    Re: MIME Mail help on NT - no sendmail! <sigvald.refsum@siemens.no>
        Newbie: Redirect syntax <hmacdonald@europarl.eu.int>
        No thread work. (Park, Jong-Pork\)
        Online CGI Needs your Scripts <support@online-cgi.co.uk>
        pb fill a form <thews@infonie.fr>
        Perl to add members to an MS Exchange DL <mmorse@nsf.gov>
    Re: Perl/CGI file transfer <philipg@atl.mediaone.net>
        Reading a remote file. brian.russo@nextel.com
    Re: Reading remote files brian.russo@nextel.com
        Remove carriage returns from input <rga@io.com>
    Re: Remove carriage returns from input <philipg@atl.mediaone.net>
    Re: Sony Versus Microsoft <nickco3@yahoo.co.uk>
    Re: Sony Versus Microsoft <nickco3@yahoo.co.uk>
        Storable - segfaults and flock.. (lengthy) <eivind@solbors.no>
    Re: Storable - segfaults and flock.. (lengthy) <eivind@solbors.no>
        translation! <T.Cockle@staffs.ac.uk>
        Troubles with Async.pm pedja@dds.nl
    Re: use strict: why? nobull@mail.com
    Re: use strict: why? ()
    Re: use strict: why? (Keith Calvert Ivey)
    Re: use strict: why? <flavell@mail.cern.ch>
    Re: using the value of a variable for another varible's <rick.delaney@home.com>
    Re: using the value of a variable for another varible's (Mark-Jason Dominus)
    Re: visited urls nobull@mail.com
    Re: What is the best way to package and distribute perl <randy@theoryx5.uwinnipeg.ca>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 05 Sep 2000 12:37:05 +0100
From: nobull@mail.com
Subject: Re: "list" vs "array" (was: @_ as array)
Message-Id: <u9lmx73w9q.fsf@wcl-l.bham.ac.uk>

dkcombs@netcom.com (David Combs) writes:

> Am confused about terminology: what is the difference
> between a "list" and an "array"?

Please see FAQ: "What is the difference between a list and an array?"

> Does "list" refer ONLY to a "LITERAL" thing, eg
>    (10, 20, "foo", (4, 5))

No.  The above is an expression.  So is foo(). 

In Perl an expression is evaluated in a list, scalar or void context.
(Actually scalar subdivides into untyped-scalar, string, numeric, boolean
and maybe some others).

If any expression is evaluated in a list context then it's a list.

Your above expression could be evaluated in a scalar context in which
case it would just be a long way to write the scalar literal 5.

> When you ASSIGN a list (as above) to a variable, then
> regardless of how you do it, you then have an ARRAY (or
> ref to one)?

Yes.

> No such thing as a list "in" a variable?

Yes.  Except that @_ is special and is almost like having a list in a
variable.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue,  5 Sep 2000 06:03:08 EDT
From: degruyl@superlink.net (David de Gruyl)
Subject: Re: ASCII code
Message-Id: <8p2gcs$149t$1@earth.superlink.net>

On Tue 05 Sep, Daniel <dchan@wcwpt.com.hk> wrote:

> Is there any function in Perl for getting the ascii code of a
> character?

       ord EXPR

       ord     Returns the numeric (ASCII or Unicode) value of
               the first character of EXPR.  If EXPR is omitted,
               uses `$_'.  For the reverse, see the chr entry
               elsewhere in this document.  See the utf8 manpage
               for more about Unicode.

I do believe that this is what you are looking for (from perlfunc man
page).

David

-- 
David de Gruyl <degruyl@superlink.net>
Part of language design is purturbing the proposed feature in various
directions to see how it might generalize in the future.
             -- Larry Wall in <199709032332.QAA21669@wall.org>
 


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

Date: 05 Sep 2000 12:18:17 +0100
From: nobull@mail.com
Subject: Re: ASCII code
Message-Id: <u9pumj3x52.fsf@wcl-l.bham.ac.uk>

Daniel <dchan@wcwpt.com.hk> writes:

> Is there any function in Perl for getting the ascii code of a
> character?

perldoc perlfunc/"Perl Functions by Category" lists 22 "Functions for
SCALARs or strings".  How long would it have taken for you to read the
first sentence of the definition of each of these?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 5 Sep 2000 15:11:14 +0100
From: "Phil" <Phil@moonhead.org.uk>
Subject: CGI retrieve file and save
Message-Id: <8p2uuf$odf$1@bignews.shef.ac.uk>

Can someone give me a hint how I might take a URL... retrieve the file
pointed to and save it ?

Thanks




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

Date: Tue, 05 Sep 2000 16:32:21 +0200
From: Marco Natoni <foo@bar.va>
Subject: Re: CGI retrieve file and save
Message-Id: <39B503F5.93D6C8BF@bar.va>

Phil,

Phil wrote:
> Can someone give me a hint how I might take a URL... retrieve the 
> file pointed to and save it ?

  Read the documentation about the LWP modules:  They do exactly what
you need.


	Best regards,
		Marco


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

Date: 05 Sep 2000 12:45:06 +0100
From: nobull@mail.com
Subject: Re: Compiling Perl for Teminal behavior
Message-Id: <u9k8cr3vwd.fsf@wcl-l.bham.ac.uk>

hwestiii@zdnetmail.com writes:

> I am looking for some help in compiling Perl (on either Red Hat 6 or
> Slackware 7) to get "correct" terminal handling behavior.

Perl doesn't have terminal handling as such.  It just treats terminal
devices as character devices.  Basic Unix terminal devices are very
rudimentary.  If you want fancy terminal handling beyond what's in the
OS consider using Term::ReadLine.  There are also ways in Unix to have
a front-end application that gives more fancy line editing to
applications that use the simple canonical tty interface.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 5 Sep 2000 15:44:50 +0100
From: "John Plaxton" <19wlr@globalnet.co.uk>
Subject: dates Calculations
Message-Id: <8p30og$gin$3@gxsn.com>

Hi there,

I'm quite new to perl so hope this isn't too ...............

I'm using
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); with
arrays for the days and months to get the current date.

Then I want to add a day or a week to the date and reformat the date any
Ideas?

Also does anyone have a procedure for encrypting and decrypting strings?

Thanks in Advance

john






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

Date: Tue, 5 Sep 2000 10:32:52 -0400
From: "Stan Rydz" <rydz@erols.com>
Subject: dmake of PERL-5.6.0 using MSVC60 compiler gens error C2061 in ..\iperlsys.h and ..\proto.h
Message-Id: <8p2vva$i3v$1@bob.news.rcn.net>

I am trying to build perl.exe for windows98 from the CPAN distribution of
PERL-5.6.0 using Microsoft VC6.0.

Running dmake generates syntax errors in header files: iperlsys.h and
proto.h. and I don't know enough to find the cause of the problem.

I checked through FAQs, readme files, install.txt etc and could not find any
issues that address this.

Here are examples of the messages I received:

 ..\iperlsys.h(412) : error C2061 : syntax error : identifier '__attribute__'
 ...
 ..\proto.h(105) : error C2061 : syntax error : identifier '__attribute__'
 ...
I'm hoping someone else has encountered this problem and can tell me how to
fix it.

Thanks in advance.





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

Date: Tue, 5 Sep 2000 16:19:42 +0200
From: Christian Oehring <Christian.Oehring@de.bosch.com>
Subject: Getting some Infos about Servers
Message-Id: <8p2vk8$j7i$1@proxy.fe.internet.bosch.de>

Hi,

Following Problem : I'm starting a programm "srvinfo.exe \\servername" and
this program returns following list : (without Lines ...)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++

Server Name: SERVERNAME

Security: Users

NT Type: NT Advanced Server

Version: 5.0, Build = 2195, CSD = Service Pack 1

Domain: DOMAIN

PDC: \\DOMAINCONTROLLER

IP Address: 1.2.3.4

CPU[0]: x86 Family 6 Model 5 Stepping 2

Hotfixes:

[Q147222]:

Drive: [FileSys] [ Size ] [ Free ]

C$ NTFS 4103 1998

Services:

[Stopped] Alerter

[Stopped] Application Management

[Running] Computer Browser

[Stopped] Indexing Service

[Stopped] ClipBook

[Running] DHCP Client

[Stopped] Logical Disk Manager Administrative Service

[Running] Logical Disk Manager

[Running] DNS Client

[Running] Event Log

[Running] COM+ Event System

[Stopped] Fax Service

[Running] Server

[Running] Workstation

[Running] TCP/IP NetBIOS Helper Service

[Running] Messenger

[Stopped] NetMeeting Remote Desktop Sharing

[Stopped] Distributed Transaction Coordinator

[Running] Windows Installer

[Stopped] Network DDE

[Stopped] Network DDE DSDM

[Running] Net Logon

[Running] Network Connections

[Stopped] NT LM Security Support Provider

[Running] Removable Storage

[Running] Plug and Play

[Running] IPSEC Policy Agent

[Running] Protected Storage

[Stopped] Remote Access Auto Connection Manager

[Stopped] Remote Access Connection Manager

[Stopped] Routing and Remote Access

[Running] Remote Registry Service

[Stopped] Remote Procedure Call (RPC) Locator

[Running] Remote Procedure Call (RPC)

[Stopped] QoS RSVP

[Running] Security Accounts Manager

[Stopped] Smart Card Helper

[Stopped] Smart Card

[Running] Task Scheduler

[Running] RunAs Service

[Running] System Event Notification

[Stopped] Internet Connection Sharing

[Running] Print Spooler

[Stopped] Performance Logs and Alerts

[Running] Telephony

[Stopped] Telnet

[Running] Distributed Link Tracking Client

[Stopped] Uninterruptible Power Supply

[Stopped] Utility Manager

[Running] Windows Time

[Running] Windows Management Instrumentation

[Running] Windows Management Instrumentation Driver Extensions

Network Card [0]:

System Up Time: -75629 Hr -18 Min -1 Sec

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++

The Problem is, I have a List of Servernames, and I want to call the Program
with the listentries as the Parameter, and the output must only contain the
following:

+++++++++++++++++++++++++++++++++++++++++
NT Type: NT Advanced Server

Version: 5.0, Build = 2195, CSD = Service Pack 1

Domain: DOMAIN

PDC: \\DOMAINCONTROLLER

IP Address: 1.2.3.4

++++++++++++++++++++++++++++++++++++++++++

The whole Process have to run in Perl. I never programed in Perl, who can
help ???

Thanks a Lot,


Christian




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

Date: 5 Sep 2000 14:24:24 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: How to copy directory tree
Message-Id: <8p2vmo$hjc$2@canopus.cc.umanitoba.ca>

In comp.lang.perl.misc, 
    Lincoln Marr <lincolnmarr@nospam.europem01.nt.com> wrote:

> I've had a look in the perldocs and deja to see how I can do this, but i
> can't find anything. So could somebody tell me how to copy an entire
> directory structure and all the files in it to another directory?
> I looked at File::Path and File::Copy but all I understood was moving and
> removing directories, not making copies of them or renaming them.

Try the File::NCopy module - documentation on its use is 
available, eg, at
http://theoryx5.uwinnipeg.ca/CPAN/data/File-NCopy/File/NCopy.html

best regards,
randy kobes


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

Date: Tue, 05 Sep 2000 13:59:13 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: How to make eval() secure with backtick?
Message-Id: <39b4fc30.41ac$c2@news.op.net>

In article <u98zt7w6pv.fsf@wcl-l.bham.ac.uk>,  <nobull@mail.com> wrote:
>mjd@plover.com (Mark-Jason Dominus) writes:
>Yes but context depends on other metacharacters.  And AFAIK the worst
>that will happen is you'll get some unwanted backslashes in the data.

Yes, that is just the problem there: 'AFAIK'.

Yesterday someone here said that to be safe when interpolating a
user-supplied input into a filename you should use the following code:

        if($check=~/(\|)|(\^)|(\*)|(\%)|(\&)|(\`)|(<)|(>)|(;)/){

He said "It works for me!"  But he was wrong.

I am going to repeat what I said before: The shell is very
complicated.  Hardly anyone understands all the things it does.
People with years of shell programming experince get nasty surprises.
That is why we like to avoid the shell.

When you say that you think you understand the shell, you are making
the same mistake that many people have made many times in the past.
They also thought they understood the shell.   They were wrong, and
then they got sabotaged.  

That is why the advice that you hear is to avoid the shell whenever
possible.  Because time after time, people who said that they thought
the situation was safe have turned out to be mistaken.

The only way to be sure that you have fixed this problem is to stop
thinking.  We stop thinking about whether we have covered each and
every one of the possibilities for disaster, and instead we take the
broad step of getting rid of the shell entirely.  You can be sure that
the shell is safe if you don't use it.

>I challenge you to find a value of $val and a _credible_ value of $cmd
>that allow the malicious user to malicious stuff.

That is missing the point, again.  Suppose I couldn't meet the
challenge.  What would that prove?  Just that Bernstein has nothing to
fear from me.  But by putting the program out in the first place,
Berstein will be challenging everyone in the entire world, including
people who are more interested in sabotage than I am.

I do have an example, by the way.  I am not going to tell you what it is.



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

Date: Tue, 05 Sep 2000 13:37:24 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: HTML::Mason as a templating tool.
Message-Id: <oG6t5.15418$gg.4086315@typhoon.southeast.rr.com>

Omri Schwarz <ocschwar@mit.edu> wrote in message
news:39B477C1.C29F72E4@mit.edu...
> I have a directory with HTML files that have Mason calls in them.
> (~/www/components)
> I have components in that directory.
>
> I want Mason to process say ~/www/components/index.html and output
> HTML into ~/www/index.html
>
> I thought this script (genweb) would do it:
[snip]

Have you posted to the Mason mailing list?
http://www.masonhq.com/maillist.html







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

Date: Tue, 05 Sep 2000 11:18:19 GMT
From: steven <steven@ircnet.dk>
Subject: Re: IPC::Shareable "Munged shared memory segment" errors
Message-Id: <8p2kpk$8uk$1@nnrp1.deja.com>

In article <8p2eem$2ea$1@nnrp1.deja.com>,
  steven <steven@ircnet.dk> wrote:
> Hi,
>
> I'm using IPC::Shareable 0.51 under Perl 5.6.0 and mod_perl 1.24 on
> Linux 2.0.36, I have a shared hash which is created and accessed fine
> until I delete() a hash element.

Ok after more playing I thought I'd copy the tied hash to a temporary
hash, make the changes there and copy the hash back. I lock the tie
using the method in the pod and issue a normal:

%hash = %temp;

Yet the element I deleted still appears in the original tied hash. Is
there a problem with deleting elements from tied hashes with
IPC::Shareable under mod_perl? I'm starting to think it may be a
variable scope and/or lifetime thing, but I'm still stumped as to how to
solve this.

Cheers,

--
steven


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 05 Sep 2000 13:32:14 +0200
From: Sigvald Refsum <sigvald.refsum@siemens.no>
To: Tracy Terrell <tracyterrell@entersysgroup.com>
Subject: Re: MIME Mail help on NT - no sendmail!
Message-Id: <39B4D9BE.B7D44C7F@siemens.no>

This may help you a little bit on the way:

As You can see the code goes thru several parts of the
Outlook possibilities. The code is not perfect, as I only dabble
in perl to autogenerate C/C++ code from Word specifications,
but You should be able to grasp the general idea.

Dont remember why I dont "use strict".

Hope this helps You.
Sigvald Refsum


### Code follows
use Win32::OLE qw(in with);

my $OutLook = Win32::OLE->new('Outlook.Application.8')
   or die "Couldn't connect to Outlook";

my $NewMail;
# Create Mail object
$NewMail = $OutLook->CreateItem(0);

# Address Mail Object, can be repeated for several recipients, also #
sigvald.refsum@siemens.no
# $NewMail->Recipients->Add('sigvald'); Check against address books
# $NewMail->Recipients->Add('sigvald.refsum@siemens.no');
$NewMail->Recipients->Add('sigvald');

# CC Address Mail Object, can be repeated for several recipients
$NewMail->Recipients->Add('sigvald');
$NewMail->Recipients->Item('sigvald')->{Type} = 2;

# Resolve addresses
$NewMail->Recipients->ResolveAll();

# Categories string
$NewMail->{Categories} ="PVCS operation";

# Voting option string
$NewMail->{VotingOptions} ="Pizza;Salat;China";

# Originator Delivery Report Requested
$NewMail->{OriginatorDeliveryReportRequested} = 1;

# Subject string
$NewMail->{Subject} ="hei";

# Body
$NewMail->{Body} = "kåre heisan\n";

#Attachments
$NewMail->Attachments->Add('H:\C_wrk\parser\outlookSend.pl');

# Print
# $NewMail->PrintOut();

# Reminder
my $hour   = (16 * 3600)*(1/86400);
my $minute = (20 * 60)*(1/86400);

$NewMail->{FlagDueBy} = 36538+$hour+$minute;
$NewMail->{FlagRequest} = 'Review Tue 13.01.00 16:20';


# Away it goes
$NewMail->Send;

# Quit
$OutLook->Close();





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

Date: Tue, 05 Sep 2000 15:12:03 +0200
From: harry <hmacdonald@europarl.eu.int>
Subject: Newbie: Redirect syntax
Message-Id: <39B4F123.E634720C@europarl.eu.int>

Can anyone please sort me out.

I'm executing a perl script inside an IIS server.
And from within the perl script I want to go to another URL.

I think what I need is a redirect - so I've tried the redirect syntax from
CGI.pm :-
$query->redirect(-uri=>'http://site/page.htm',     -nph=>1);
But this just displays in the browser the following message :-
"HTTP/1.0 302 Moved Status: 302 Moved Location: http://site/page.htm "

Thanks in advance
Harry




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

Date: Tue, 5 Sep 2000 20:04:22 +0900
From: "¹ÚÁ¾º¹ \(Park, Jong-Pork\)" <okletsgo@hitel.net>
Subject: No thread work.
Message-Id: <8p2j4i$9h5$1@news1.kornet.net>

I have ActiveState Perl 617 MSWin32-multi-thread version. But it didn't work thread.


I try this(it is sample source in thread document):

 use Thread;

 my $t = new Thread \&start_sub, @start_args;

 $result = $t->join;
 $result = $t->eval;
 $t->detach;



c:\test>test.pl
No threads in this perl at C:\Source Codes\test\test.pl line 3.


What I wrong?? I think it is bug.






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

Date: Tue, 5 Sep 2000 13:43:34 +0100
From: "Online CGI" <support@online-cgi.co.uk>
Subject: Online CGI Needs your Scripts
Message-Id: <39b4eb90@news.telinco.net>

Have you designed a script & want to let everyone use it?

Well Online CGI can help you. This soon to be online site is currently
looking for more CGI scripts to add to it's already growing database.
So if you have designed a script that you think deserves exposure, then
e-mail your script to, scripts@online-cgi.co.uk
Please include contact details and full installation details.
------------------------------------------------------------------------

Online CGI is a 100% free service dedicated to giving your scripts their
deserved exposure & will allow anyone to download them.

There will be many other features on Online CGI, including the following:

 . Database of CGI scripts
 . CGI Tutorials
 . Monthly e-mail providing details of new scripts
 . CGI Helpdesk (Post a problem to other users)
 . Plus many other features

If you have any questions about the site, or you have a suggestion, please
e-mail support@online-cgi.co.uk

------------------------------------------------------------------------
www.online-cgi.co.uk






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

Date: Tue, 05 Sep 2000 15:40:19 +0200
From: thewz <thews@infonie.fr>
Subject: pb fill a form
Message-Id: <39B4F7C3.82105EAA@infonie.fr>

how to fill the form of this page?
http://artists.mp3s.com/artist_email/28/thewz.html
thanks



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

Date: Tue, 05 Sep 2000 10:09:34 -0400
From: Michael Morse <mmorse@nsf.gov>
Subject: Perl to add members to an MS Exchange DL
Message-Id: <KP60OVDnbx8XKKT4ta9ezVBbLFJX@4ax.com>

Has anybody written any perl to add addresses to a Microsoft Exchange
DL?  If you'd be willing to share it, it would save me probably a
couple of days rummaging through the CDO documentation.

--Mike


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

Date: Tue, 05 Sep 2000 13:34:17 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: Perl/CGI file transfer
Message-Id: <tD6t5.15417$gg.4085120@typhoon.southeast.rr.com>

alan <alanhll@alphalink.com.au> wrote in message
news:sr985p9fa6e162@corp.supernews.com...
>
> Philip Garrett wrote:
> >
> >
> > alan <alanhll@alphalink.com.au> wrote in message
> > news:sr8mjab0a6e40@corp.supernews.com...
[snip]
> > perldoc CGI
> > Look for "Creating a File Upload Field."  It also explains how to
receive
> > file uploads.  Something like this:
> >
> > use CGI;
> > my $q = new CGI;
> > my $filename = $q->param('file1');
> > my $filehandle = $q->upload('file1');
> > while (<$filehandle>) {
> >     ... do file stuff here ...
> > }
> >
[snip]
> Thanks for that. I found some documentation about CGI.pm which covers a
bit
> of this topic, but still dosn't really explain how to receive, read and
use
>  the file within a cgi program. Where is perldoc CGI that you refer to?
> Pleez?

Type 'perldoc CGI' at your shell prompt (or [blech] at your DOS prompt).  If
you have ActivePerl, look for the CGI module in the left pane of the
documentation.

Anyway, an example of how to use follows:

open OUTFILE, ">myfile" or die $!;
while (<$filehandle>) {
        print OUTFILE $_;
}
close OUTFILE or warn $!;

hth,
Philip




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

Date: Tue, 05 Sep 2000 14:17:54 GMT
From: brian.russo@nextel.com
Subject: Reading a remote file.
Message-Id: <8p2va7$jcr$1@nnrp1.deja.com>

Does anyone know if there is a module or technique available which will
allow me to open a file for READ only on a remote UNIX system. I would
like to avoid NFS mounting the filesystem or physically copying the file
to my local box. The remote system is a trusted host and the files are
not owned by root.

Thanks in advance,

-Brian


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 05 Sep 2000 14:24:33 GMT
From: brian.russo@nextel.com
Subject: Re: Reading remote files
Message-Id: <8p2vmk$jno$1@nnrp1.deja.com>

I just want to access the file using a perl script on a local UNIX box.
My intent is not to copy the file but to read, parse and produce output
from it without the file residing on the same machine as the script. My
thought was along the lines of rsh-ing to the remote machine and then
cat-ing the file or something like that.

-Brian

In article <399C235E.16763A6B@salvador.venice.ca.us>,
  admin@salvador.venice.ca.us wrote:
> What kind of files are you talking about?  If it is just text, http
> might be a candidate.  But there are different methods for different
> chores.  Anyone else using SIP-CGI ?
>
> Tony Curtis wrote:
> >
> > >> On Thu, 17 Aug 2000 13:20:08 GMT,
> > >> brian.russo@nextel.com said:
> >
> > > Does anyone know if there is a way to read a file from a
> > > remote (trusted) host? I would like to read the remote
> > > file(s) and avoid nfs mounting the directory.
> >
> > > Is there a perl module that can do this?
> >
> > How do you intend to get the remote file?  ftp? scp?
> > kerberised ftp? something else?
> >
> > t
> > --
> > "I'm not easily impressed.  Wow!  A blue car!"
> >                                                Homer Simpson
>
> --
> Salvador Peralta
> admin@salvador.venice.ca.us
> http://www.la-online.com
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 5 Sep 2000 08:14:31 -0500
From: "RGA" <rga@io.com>
Subject: Remove carriage returns from input
Message-Id: <Ru6t5.61106$g53.970650@news5.giganews.com>

Hope I don't stimulate too many of the Unsenet police with this silly Q,

I need to strip out any carriage returns from my input.

What's the character to match on.
I have 2 books, but can't find ..

Can't I do a simple

 $results =~ s/chr(10)//g;

  Whatever that nasty carriage return is ?

 Thanks..




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

Date: Tue, 05 Sep 2000 13:44:15 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: Remove carriage returns from input
Message-Id: <PM6t5.15421$gg.4088888@typhoon.southeast.rr.com>

RGA <rga@io.com> wrote in message
news:Ru6t5.61106$g53.970650@news5.giganews.com...
> Hope I don't stimulate too many of the Unsenet police with this silly Q,
>
> I need to strip out any carriage returns from my input.
>
> What's the character to match on.
> I have 2 books, but can't find ..
>
> Can't I do a simple
>
>  $results =~ s/chr(10)//g;
>
>   Whatever that nasty carriage return is ?

Carriage return is "\r".  Try s/\r//g.

hth,
Philip




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

Date: Tue, 05 Sep 2000 14:13:23 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: Sony Versus Microsoft
Message-Id: <39B4F173.8686E54C@yahoo.co.uk>

"Godzilla!" wrote:

> Nick Condon wrote:
>
> >  - You've written a Perl script that passes the Turing test?
>
> Yes.

ROFLMAO!  I expect your Nobel prize is in the post.



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

Date: Tue, 05 Sep 2000 14:20:05 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: Sony Versus Microsoft
Message-Id: <39B4F305.7460EFAA@yahoo.co.uk>

"Godzilla!" wrote:

> Yes. Read Martian Chronicles. Part of Bradbury's novel
> is based upon my android daughter.

Ray Bradbury's "The Martian Chronicles" is not a novel, but a collection of
loosely connected short stories, written before you and I were born.

I'm beginning to wonder if *you* are capable of passing the Turing test.



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

Date: 05 Sep 2000 15:13:01 +0200
From: Eivind Trondsen <eivind@solbors.no>
Subject: Storable - segfaults and flock.. (lengthy)
Message-Id: <lt3djft21u.fsf@spitfire.osl.solbors.no>


Hi all

I have I library for server-side cacheing of database-fetched stuff
that I have some problems with. I was hoping to use Storable as
serializing method, but it keeps failing and segfaulting.

My perl is 5.005_03, and my Storable is 0.702. System is Redhat 6.2.

The problems are, it seems, related to the fact that the files
Storable uses is not locked in any way. I have tried to lock them
myself using store_fd and retrieve_fd, but it does not help. It seems
like the different processes are reading and writing on top of each
other.

A collateral problem is that when the Storable-operation is enclosed
in an eval, all error conditions result in a segfault.

The script below illustrates the problem. The data I retrieve is from
an internal library. If anybody wants to run this, send me a mail and
I'll mail the data.

-- start script --
#!/usr/bin/perl

use KUBA::Item;
use Storable qw(store_fd retrieve_fd);
use Data::Dumper;
use Fcntl qw(:flock);

# Original data
my $file = "/tmp/storablee";

# File that storable uses.
my $dumphole = "/tmp/dumphole";
my $iterations = 100;

sub getData {
    open FILE, "$file" or die "Hmpf...";
    $/ = undef;
    my $data = <FILE>;
    close FILE;
    return eval $data;
}

# Here I get the data from my custom library. Ignore it.
# The dataseries in $file can be sent on request.
if ( $ARGV[0] eq "write" ) {
    my $item=KUBA::Item->open(61);
    my $data = $item->getIntraDay(1);
    
    open FILE, ">$file" or die "Hmpf...";
    local $Data::Dump::Purity = 1;
    print FILE Dumper $data;
    close FILE;
}
# For personal amusement...
elsif ( $ARGV[0] eq "test" ) {
    my $data = &getData;
    print $#{ $data };
}

# This is the real test case:
else {
    my $data = &getData;
    print "$$ starting iterations for fd\n";
    foreach ( 1 .. $iterations ) {
	eval {  # This causes all errors to become segfaults
	    open FILE, ">$dumphole" or die "Bummer..";
	    flock FILE, LOCK_EX;
	    store_fd ($data, \*FILE);
	    flock FILE, LOCK_UN;
	    close FILE;
	    
	    open FILE, $dumphole or die "Bummer..";
	    flock FILE, LOCK_EX;
	    retrieve_fd(\*FILE);
	    flock FILE, LOCK_UN;
	    close FILE;
	};
	print "$$: $_\n" if ( $_ % 10 == 0 );
    }
    print "$$ done\n";
}

-- end script --

TESTRUN WITH THE EVALS;
[eivind@spitfire testcrap]$ ./storabletest.pl &
[1] 2583
[eivind@spitfire testcrap]$ ./storabletest.pl &
[2] 2584
[eivind@spitfire testcrap]$ 2583 starting iterations for fd
2583: 10
2584 starting iterations for fd
2583: 20
Out of memory!
2584: 10
2584: 20
2584: 30
2584: 40
2584: 50
2584: 60
2584: 70
2584: 80
2584: 90
2584: 100
2584 done

[1]-  Segmentation fault      (core dumped) ./storabletest.pl
[2]+  Done                    ./storabletest.pl
[eivind@spitfire testcrap]$ 

TESTRUN WITHOUT THE EVALS;
[eivind@spitfire testcrap]$ ./storabletest.pl &
[1] 2606
[eivind@spitfire testcrap]$ ./storabletest.pl &
[2] 2607
[eivind@spitfire testcrap]$ 2606 starting iterations for fd
2606: 10
2607 starting iterations for fd
2606: 20
File is not a perl storable at blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/retrieve_fd.al) line 209, at ./storabletest.pl line 54
2607: 10
2607: 20
2607: 30
2607: 40
2607: 50
2607: 60
2607: 70
2607: 80
2607: 90
2607: 100
2607 done

[1]-  Exit 255                ./storabletest.pl
[2]+  Done                    ./storabletest.pl
[eivind@spitfire testcrap]$ 

Any help much appreciated! :-)

-- 
Eivind Trondsen                                   Norge-iNvest
Technical Manager                  http://www.norge-invest.com

Phone +47 22987843    Fax +47 22987848     Mobile +47 97044324
                          - - - 
'There is a theory which states that if ever anyone discovers
exactly what the Universe is for and why it is here,
it will instantly disappear and be replaced by something
even more bizarre and inexplicable.

There is another theory which states that this has already 
happened.'
                                                 Douglas Adams
                     The Restaurant at the End of the Universe


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

Date: 05 Sep 2000 16:07:58 +0200
From: Eivind Trondsen <eivind@solbors.no>
Subject: Re: Storable - segfaults and flock.. (lengthy)
Message-Id: <ltvgwbrkxt.fsf@spitfire.osl.solbors.no>


Just found out that 1.0.0 of Storable was out. It didn't solve my
problem...

-- 
Eivind Trondsen                                   Norge-iNvest
Technical Manager                  http://www.norge-invest.com

Phone +47 22987843    Fax +47 22987848     Mobile +47 97044324
                          - - - 
'There is a theory which states that if ever anyone discovers
exactly what the Universe is for and why it is here,
it will instantly disappear and be replaced by something
even more bizarre and inexplicable.

There is another theory which states that this has already 
happened.'
                                                 Douglas Adams
                     The Restaurant at the End of the Universe


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

Date: Tue, 05 Sep 2000 13:19:07 +0100
From: Tim Cockle <T.Cockle@staffs.ac.uk>
Subject: translation!
Message-Id: <39B4E4BB.48736B3B@staffs.ac.uk>

Can someone give me a hint to what this means?

Attempt to free non-existent shared string at (eval
2)[C:/Perl/lib/DynaLoader.pm:219] line 1.

Thanks,

Tim



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

Date: Tue, 05 Sep 2000 12:47:55 GMT
From: pedja@dds.nl
Subject: Troubles with Async.pm
Message-Id: <8p2q1p$du9$1@nnrp1.deja.com>

Hi,

I am trying to us Async module
http://www.perl.com/CPAN/authors/id/MJD/Async-0.10.tar.gz , but main
problem is that code works very strange. Sometime is everything OK and
sometime I get no results from proces but also not a error message. I
saw that somebody already has the same problem (buffering) and released
a fix for it ( http://x73.deja.com/[ST_rn=ps]/getdoc.xp?
AN=595838590&CONTEXT=968150495.1310261258&hitnum=0 ), but this not work
for me.

Any advice?
Thanks
Pedja




Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 05 Sep 2000 12:29:23 +0100
From: nobull@mail.com
Subject: Re: use strict: why?
Message-Id: <u9n1hn3wmk.fsf@wcl-l.bham.ac.uk>

tim@degree.ath.cx (Tim Hammerquist) writes:

> I've noticed in this NG that 'use strict' is often encouraged much like
> a dealer pushes drugs.

A better metaphor would be "like a doctor pushes a healthy lifesytle".

> I completely understand it's benefits as a pragma.  However, it's
> not a rule.

Yes, and the odd unhealthy meal won't hurt either.

> And while anything I write larger than 50 lines (almost always) has this
> pragma, there are times that 'use strict' disallows a feature you
> attempt to use.  

That's why there's "no strict".

> Tom C. gave some examples in Cookbook that wouldn't
> work under 'use strict'.

Unless these are presented as standalone one-liner recipies then
IMNSHO they should be considerd wrong unless they contain the relevant
"no strict" pragma.

> To boot, when I work under 'use strict', I sometimes just feel
> claustrophobic.

I find the same when I try to use less fat in my cooking.

> In practice, code is "wrong" when it doesn't do what you want.

Yes but if it doesn't do what you want then you should try it with the
strictures in place before asking for help from others.

If you get ill because of an unhealthy lifesytle and go to the doctor
you'll get a lecture on healthy living.

If you get bugs that would have been avoided by strict or warnings and
come to comp.lang.perl.misc you'll get a lecture on healthy programming.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 05 Sep 2000 12:31:53 GMT
From: sjs@yorku.ca ()
Subject: Re: use strict: why?
Message-Id: <slrn8r9pup.e5.sjs@john.sympatico.ca>

In comp.lang.perl.misc, you wrote:
> I've noticed in this NG that 'use strict' is often encouraged much like
> a dealer pushes drugs.  I completely understand it's benefits as a
> pragma.  However, it's not a rule.

I think one reason you see exhortations to use strict so often on
clpm is that the community here often has to deal with the 
consequences of *not* using strict.  

Sure, if you're writing something small you don't necessarily need 
it.   But many newbies will write an unreadable piece of trash 
without strict, and come to the newsgroup with a mysterious error 
caused by confusing $variable and %variable, or a spelling mistake, 
or something similar.  And most people are less willing to help
someone who hasn't helped themselves--i.e., used all of Perl's
features to diagnose programming errors.
 
Thus the usual line that you should use strict until you know
enough to recognize when it is appropriate not to.  If you're going
to be helping correct their errors, I think it's a good rule of
thumb.

Steve


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

Date: Tue, 05 Sep 2000 13:04:35 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: use strict: why?
Message-Id: <39b5ee1a.52171090@news.newsguy.com>

tim@degree.ath.cx (Tim Hammerquist) wrote:

>And large programs would benefit greatly from this pragma.  However,
>many of the scripts I write for my home system (or that I need to ask a
>question about) fit into the "casual" definition, an exception mentioned
>in the Camel.

If they're casual programs, they're presumably short, so it
shouldn't take you long to make them strict-safe if you have a
question.  And just maybe in the process you'll find the answer
to your question without having to consult the newgroup.  The
number of questions in the group is overwhelming, so it's a good
idea to eliminate as many of the ones that can be easily
answered by "use strict;" as possible, so that the answerers can
help more people.  Why is that a problem?

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC


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

Date: Tue, 5 Sep 2000 16:01:52 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: use strict: why?
Message-Id: <Pine.GHP.4.21.0009051553120.16913-100000@hpplus03.cern.ch>

On Tue, 5 Sep 2000, Tim Hammerquist wrote:

> many of the scripts I write for my home system (or that I need to ask a
> question about) fit into the "casual" definition, an exception mentioned
> in the Camel.

Whereupon, one or both of the following will happen:

1. Conscientious advisers will recommend that you apply -w and
use strict; , and come back if you still have a problem.

2. Casual advisers may offer you random advice, which might, with
luck, help you, or might, more likely, cause you to waste your own
time and effort with pointless investigations, and confuse onlookers,
without solving the real problem.

The bottom line is that then we're all worse off, because the people
around here who can really help us get pissed off with wasting their
time cleaning up other people's messes, and handing out individual
fish fillets, instead of helping us all to learn to fish.

It's fine if you leave the safety straps off in the privacy of your
own computer; but when you're in public then I'd have to recommend
setting a good example, for your own benefit as well as for the common
good.

all the best



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

Date: Tue, 05 Sep 2000 13:09:22 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: using the value of a variable for another varible's name?
Message-Id: <39B4F2FA.2DAD6F65@home.com>


Gwyn Judd wrote:
> 
> [gwyn@thislove:~]$ cat sym.pl
> #!/usr/bin/perl -w
> use strict;
> use Benchmark;
> 
> my $day = 'monday';
> my $monday;
> my $temp;
> my $ref = \$monday;
> my %days;

None of these variables are visible inside Benchmark::timethese or
whatever the actual sub that evals the code is called.  You might want
to run this again, getting rid of all those 'my's.

> timethese (1 << 19, {
>     'sym' => '${$day} = \'11 am\';',
>     'hash' => '$days{monday} = \'11 am\';',
>     'ref' => '${$ref} = \'11 am\';',
>     'var' => '$monday = \'11 am\';',
> });

Nicer quoting couldn't hurt either.  See q// in perlop.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Tue, 05 Sep 2000 13:31:07 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: using the value of a variable for another varible's name?
Message-Id: <39b4f59a.3fbe$201@news.op.net>

In article <slrn8r91r0.3uj.tjla@thislove.dyndns.org>,
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
>I was shocked! How could Mark-Jason Dominus <mjd@plover.com>
>say such a terrible thing:
>>In article <slrn8r8nov.264.tjla@thislove.dyndns.org>,
>>Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
>>>>It's exactly as fast.
>>>
>>>It's half as fast:
>>
>>You are combining unlike things.  Obviously a regular variable access
>>is faster than a hash lookup.  But the store through the symbolic
>>reference is exactly as fast as the store into the hash.  You have
>>added together the times for these two operations.
>
>Where did you get that idea? I (and benchmark) beg to differ. Did you
>test that assertion you made?

Yes, and I tested the original assertion before I made it also.

The benchmark is at 

        http://www.plover.com/~mjd/perl/symref.pl


Your program is broken.


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

Date: 05 Sep 2000 12:25:41 +0100
From: nobull@mail.com
Subject: Re: visited urls
Message-Id: <u9og233wsq.fsf@wcl-l.bham.ac.uk>

"Troy Rasiah" <troyr@vicnet.net.au> writes:
> ie....i'm using the Apache::Session Module and every time i create a new
> session (log on) the links which i had visited previously have not
> maintained their visited color status.

URL's visited status is maintained client side.   Just make sure the
URLS don't change.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 5 Sep 2000 14:17:56 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: What is the best way to package and distribute perl programs, with included modules?
Message-Id: <8p2vak$hjc$1@canopus.cc.umanitoba.ca>

In comp.lang.perl.misc, Brandon Hoult <bhoult@netscape.net> wrote:
[ ... ]
> 	So, my question is this:  what is the best way to package and
> distribute a perl program so that it can be run by people with no
> knowledge of perl, or by people who don't want to satisfy all the
> dependencies just  to use the program?   I understand there is a way to
> compile perl into  a executable binary file... is this true, and would
> this solve the problem?   Is there some other way to statically link all
> this stuff?

What about using the CPAN.pm module to install the package? If it
encounters a dependency of one module on another, it (most often)
will offer to install the dependency for you. See 'perldoc CPAN'
for details on it's use. There may also be a Bundle module for 
the one you're trying to install that lists all dependencies up front, 
or if not, you could make up your own (see, eg, Bundle::CPAN) and
use the CPAN::Site module to get CPAN to install local packages; 
using CPAN.pm to install the Bundle will then include all the
dependencies. 

best regards,
randy kobes


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4226
**************************************


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