[18477] in Perl-Users-Digest
Perl-Users Digest, Issue: 645 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 6 18:06:08 2001
Date: Fri, 6 Apr 2001 15:05:25 -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: <986594724-v10-i645@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 6 Apr 2001 Volume: 10 Number: 645
Today's topics:
Re: 'use package' doesn't appear to work? (Jay Tilton)
Re: [JOB] Web/Database Programmer/Analyst (US-NY-Ithaca (David H. Adler)
Re: Anyone know how to handle CVS files With " in them? <Steve_Alpert@idx.com>
Re: bare block usage (Tad McClellan)
Re: bare block usage <elijah@workspot.net>
Re: cookie woes. (Abigail)
Re: Copying Directories (F. Xavier Noria)
deleting files <T_boss75@curanet.com>
Re: deleting files <juex@deja.com>
MLDBM Read/Write Problems <st9w@MailAndNews.com>
Re: password encryption (Abigail)
perl->speech charlie.openbsd@home.com
Re: Please Help <nap@illx.org>
Re: Posting Guidelines (was Re: Does this newsgroup hav (Tad McClellan)
print() and die() with multiple filehandles? Logging of <hannak@nospam.kodak.com>
problem <alwin@worldmail.nl>
Re: Question about refcounting (Abigail)
Re: Question about refcounting <uri@sysarch.com>
Reverse DNS Lookup (Anthony Delorenzo)
Re: Script for downloading Yahoo mail? <kalin@thinrope.net>
snmpwalk with perl <T_boss75@curanet.com>
System commands in script <ludmilla.markowska@gmx.net>
Re: Time difference (Abigail)
Re: Using ftell() and fseek() <milliwave@rfengineering.freeserve.co.uk>
win32: *.pl > *.exe howto <alexander.gausa@gmx.de>
Re: win32: *.pl > *.exe howto <brondsem@my-deja.com>
Re: Windows but not UNIX!? <mjcarman@home.com>
Re: Windows but not UNIX!? <carvdawg@patriot.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 06 Apr 2001 18:56:32 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: 'use package' doesn't appear to work?
Message-Id: <3ace0ccc.318828325@news.erols.com>
On Fri, 6 Apr 2001 13:41:06 -0400, "Crazy Cat"
<gmktb9cbu27001@sneakemail.com> wrote:
>For some reason perl has not imported test_DBS_User_Manager into my
>namespace and I can only get this code to run if I fully qualify the
>function name
>as dbs::test_dbs_user_manager::test_DBS_User_Manager.
The code you presented behaves as expected. Something is missing.
If you're importing any other symbols named in @EXPORT_OK of
dbs::test_dbs_user_manager, a la
use dbs::test_dbs_user_manager qw(foo bar);
then those are the only ones it will import. If you also want the
ones named in @EXPORT, you should specify :DEFAULT as well.
use dbs::test_dbs_user_manager qw(:DEFAULT foo bar);
------------------------------
Date: 6 Apr 2001 20:42:22 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: [JOB] Web/Database Programmer/Analyst (US-NY-Ithaca)
Message-Id: <slrn9csahe.dt0.dha@panix2.panix.com>
On Thu, 05 Apr 2001 10:01:40 -0400, Ray Zimmerman wrote:
>invites applications for a Web/Database Programmer/Analyst for the
You have posted a job posting or a resume in a technical group.
Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.
Had you read and understood the Usenet user manual posted frequently to
"news.announce.newusers", you might have already known this. :) (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)
Another good source of information on how Usenet functions is
news.newusers.questions (information from which is also available at
http://www.geocities.com/nnqweb/).
Please do not explain your posting by saying "but I saw other job
postings here". Just because one person jumps off a bridge, doesn't
mean everyone does. Those postings are also in error, and I've
probably already notified them as well.
If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.
http://jobs.perl.org may be of more use to you
Yours for a better usenet,
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
I have 'somefunc' bound to the 'any' key.
- Jim Flanagan, c.l.p.misc
------------------------------
Date: Fri, 6 Apr 2001 12:44:54 -0400
From: Steve Alpert <Steve_Alpert@idx.com>
Subject: Re: Anyone know how to handle CVS files With " in them?
Message-Id: <5lsrctspb9kjlctdqhtla5i655l3d9imeo@4ax.com>
"Gary Blake" <gary@tigerstripes.co.uk> wrote:
>Anyone know how to handle CVS files With " in them?
>
>I've come up blank with google searches!
>
>Gary
my @temp = ();
push(@temp, $+) while m{ "([^"]*)",?|([^,]+)|,}gx;
/sra
Steve Alpert (Steve_Alpert @ i d x . c o m)
IDX Systems Corp. Boston, Massachusetts
------------------------------
Date: Fri, 6 Apr 2001 15:57:53 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: bare block usage
Message-Id: <slrn9cs7u0.ms9.tadmc@tadmc26.august.net>
Cosmic Cruizer <c_cruizer@my-deja.com_nospam> wrote:
>I've been reading up on using bare block statements and I have to question
>it's redundant use. It seems to me that using either do-while or do-until
>would be much clearer when it comes to reading the code. I've been looking
>through examples of code, but have not seen any that uses bare blocks.
{ local $/; $_ = <> } # slurp the entire file(s)
>My questions: Does anybody here use bare blocks
Yes.
>and why?
To control variable scope.
>Is there a
>specific situation where bare blocks might be better then using a do-while
>or do-until?
How about when you don't want or need any looping?
>Any other benefits or drawbacks?
It saves typing 3 characters (a profoundly silly "benefit").
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Apr 2001 21:04:31 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: bare block usage
Message-Id: <eli$0104061659@qz.little-neck.ny.us>
In comp.lang.perl.misc, Tad McClellan <tadmc@augustmail.com> wrote:
> Cosmic Cruizer <c_cruizer@my-deja.com_nospam> wrote:
> >I've been reading up on using bare block statements and I have to question
> >it's redundant use. It seems to me that using either do-while or do-until
> >would be much clearer when it comes to reading the code.
It might be for you, but that's just personal preference.
> >I've been looking
> >through examples of code, but have not seen any that uses bare blocks.
> { local $/; $_ = <> } # slurp the entire file(s)
Also common for turning off warnings ($^W).
> >My questions: Does anybody here use bare blocks
> Yes.
Seconded.
> >and why?
> To control variable scope.
I like variables to be very local unless I am coding perl for speed.
(Globals can be faster sometimes, since they don't get reinitialized
upon re-entry to a block.)
> >Any other benefits or drawbacks?
> It saves typing 3 characters (a profoundly silly "benefit").
You can 'last' out of a bare block.
Elijah
------
and you can 'redo' if you do want a loop
------------------------------
Date: Fri, 6 Apr 2001 20:24:51 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: cookie woes.
Message-Id: <slrn9cs9gj.kpv.abigail@tsathoggua.rlyeh.net>
Kyle Dusang (hhsoft@csoft.net) wrote on MMDCCLXXV September MCMXCIII in
<URL:news:319qctkt92tvrqano5lriemtiv039jiebu@4ax.com>:
$$ Any reason why the following would not set a cookie in netscape 4.7
$$ which lasts longer than a browser session? (it does in I.E. 5)
$$
$$ print "Set-Cookie: rpassword=${password}; expires=Thu, 01-Jan-2099
$$ 00:00:00 GMT;\n";
What makes you think this is a Perl question?
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$==-2449231+gm_julian_day+time);do{until($=<$#r){$_.=$r[$#r];$=-=$#r}for(;
!$r[--$#r];){}}while$=;$,="\x20";print+$_=>September=>MCMXCIII=>=>=>=>=>=>=>=>'
------------------------------
Date: Fri, 06 Apr 2001 20:23:30 GMT
From: fxn@retemail.es (F. Xavier Noria)
Subject: Re: Copying Directories
Message-Id: <3ace2581.1873944@news.iddeo.es>
On Fri, 6 Apr 2001 14:39:49 GMT, Phil Shean <philip.shean@uwe.ac.uk> wrote:
: Is it possible to copy a directory complete with all it's contents (inc
: sub-dirs)?
http://search.cpan.org/doc/GSAR/perl-5.6.1-TRIAL3/lib/File/Copy.pm
-- fxn
------------------------------
Date: Fri, 6 Apr 2001 15:25:00 -0400
From: "T_Boss" <T_boss75@curanet.com>
Subject: deleting files
Message-Id: <pMoz6.130896$lj4.3976867@news6.giganews.com>
This is a multi-part message in MIME format.
------=_NextPart_000_0060_01C0BEAD.BEEBADB0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
How can I delete files that are not in the same directory as the perl =
script
------=_NextPart_000_0060_01C0BEAD.BEEBADB0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4308.2900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>How can I delete files that are not in =
the same=20
directory as the perl script</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0060_01C0BEAD.BEEBADB0--
------------------------------
Date: Fri, 6 Apr 2001 14:47:26 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: deleting files
Message-Id: <3ace396e$1@news.microsoft.com>
"T_Boss" <T_boss75@curanet.com> wrote in message
news:pMoz6.130896$lj4.3976867@news6.giganews.com...
> How can I delete files that are not in the same directory as the perl
script
By specifying the path?
jue
------------------------------
Date: Fri, 6 Apr 2001 14:51:38 -0400
From: Chris <st9w@MailAndNews.com>
Subject: MLDBM Read/Write Problems
Message-Id: <3AE8081A@MailAndNews.com>
I'm trying to store a relatively simple hash into a file using MLDBM. The
data *seems* to go in correctly (id est, there are no error messages and the
file is created if it doesn't already exist, modified if it does), but when
I try to view the file and print the data, I get the following error:
Can't use string ("123") as a HASH ref while "strict refs" in use at
viewcust.cgi line 23.
here@there.com:
That e-mail address is one I had previously stored in the DB. So I know
that part (the key) is going in properly. I'm not sure if I'm not storing
the actual hash correctly, or if I'm just not reading it properly. Here's
the relevant code I have for both (assume all variables have valid data
stored in them, because I'm running the script from a command line and
placing valid data into the variables -- print statements removed from code
shown below display that :) :
###
# Writing data, in file access.cgi
###
use strict; # Be good!
use CGI;
use MLDBM qw(DB_File Storable); # To support DB
use Fcntl;
use warnings "untie"; # Make sure all files are closed.
my $filename = "yppdb/customer.db";
tie ( my %customerDB, 'MLDBM', $filename, O_CREAT|O_RDWR, 0666 );
if (exists($customerDB{ $email })) {
my $tempref = $customerDB{ $email };
$tempref->{'first_name'} = $firstname;
$customerDB{ $email } = $tempref;
}else{
$customerDB{ "$email" } = {
'customer_id' => "$cid",
'first_name' => "$firstname",
'last_name' => "$lastname",
'incentive' => "FALSE",
'password' => "$pw"
};
}
undef $filename;
untie (%customerDB);
###
# Reading data, in file viewcust.cgi
###
use strict; # Be good!
use MLDBM qw(DB_File); # To support DB
use warnings "untie"; # Make sure all files are closed.
use Fcntl;
my $filename = "yppdb/customer.db";
tie ( my %customerDB, 'MLDBM', $filename, O_CREAT|O_RDWR, 0666 );
# print the whole thing
foreach my $user ( keys %customerDB ) {
my $tempVar = $customerDB{ "$user" };
print "$user: { ";
print " Customer ID : ".$tempVar->{ 'customer_id' };
print " First name : ".$tempVar->{ 'first_name' };
print " Last name : ".$tempVar->{ 'last_name' };
print " Incentive : ".$tempVar->{ 'incentive' };
print " Password : ".$tempVar->{ 'password' };
print "}\n";
}
untie (%customerDB);
Thanks in advance!
chris
------------------------------------------------------------
Get your FREE web-based e-mail and newsgroup access at:
http://MailAndNews.com
Create a new mailbox, or access your existing IMAP4 or
POP3 mailbox from anywhere with just a web browser.
------------------------------------------------------------
------------------------------
Date: Fri, 6 Apr 2001 20:29:10 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: password encryption
Message-Id: <slrn9cs9om.kpv.abigail@tsathoggua.rlyeh.net>
Simon Stiefel (SiStie@nuclear-network.com) wrote on MMDCCLXXV September
MCMXCIII in <URL:news:Pine.LNX.4.31.0104061836340.1824-100000@server.stiefel.priv>:
$$ Hi,
$$
$$ I have to transmit a password with the "get"-function to my CGI-Script (so
$$ it can be seen by everyone).
$$
$$ What is the easiest way to encrypt and decrypt the password?
I find the easiest way to append an emptry string. That's a nice
symmetric algorithm - you can use the same for decryption and
encryption.
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
------------------------------
Date: Fri, 06 Apr 2001 20:20:03 GMT
From: charlie.openbsd@home.com
Subject: perl->speech
Message-Id: <Txpz6.215984$t67.4035034@news1.rdc1.il.home.com>
hello, i've been playing with trying to get festival
to speak perl in a way i can understand what is being said
just thought i'd throw this idea out there, see
if anybody's interested in helping and/or just curious
here's the code i've written so far
it's very sloppy and i don't know much about perl
to clean it up much (maybe there's a tutorial out there on clean perl code?
but it gives a general idea, the program logos is just
a copy of festival's text2wave with the name changed
__BEGIN PERL CODE__
------------------------------
Date: Fri, 06 Apr 2001 15:14:47 -0700
From: Nick Pinckernell <nap@illx.org>
Subject: Re: Please Help
Message-Id: <3ACE3FD7.1020301@illx.org>
I'm assuming your trying to write out to a file.
If so, your forgetting the 'mode' for writing.
which is a > in front of the filename in your open
statement.
open(FILEHANDLE, ">$file");
_nick
Waarddebon wrote:
> Why doesn't this work ?
>
> $remote2="today";
> open (THEFILE,"/data1/hm/makers/bezoekers/$remote2");
> print THEFILE "hi";
> close THEFILE;
------------------------------
Date: Fri, 6 Apr 2001 15:35:57 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Posting Guidelines (was Re: Does this newsgroup have an FAQ?)
Message-Id: <slrn9cs6kt.ms9.tadmc@tadmc26.august.net>
Michel Dalle <michel.dalle@usa.net> wrote:
>In article <slrn9crd8o.lp0.tadmc@tadmc26.august.net>, tadmc@augustmail.com wrote:
>>It is (for now) available on my personal web site:
>>
>> http://www.augustmail.com/~tadmc/clpmisc_guide/
>>
>>It will soon be available on some pm.org web page.
>
>Suggestion : explain in a bit more detail *how* people
>are supposed to "check the Perl FAQ" and "check the
>other standard Perl docs".
That is the purpose of _other_ regular postings.
I might add a mention of those other resources, but I don't see any
advantage in repeating the info.
Also, it is nearly "maximum size" as it is. If it gets too much
bigger folks won't bother reading it. If I'm to add something,
we need to identify something else that I can take out to make
room for it...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 06 Apr 2001 16:34:47 -0400
From: Victor Hannak <hannak@nospam.kodak.com>
Subject: print() and die() with multiple filehandles? Logging of printed data?
Message-Id: <3ACE2867.86BD6C89@nospam.kodak.com>
I am writing a script that queries users on several topics and acts
accordingly while providing user feedback via print statements or die
statements (in case of errors). I would like to create a log file of
the proceedings, but I do not want to have to duplicate each print
statement. Further, I am unsure how to handle die() statements.
Is there a way to tie multiple filehandles to one name so that all
output goes to both stdout and a log file? What about the die function,
which doesn't even take a filehandle argument?
Is there maybe a UNIX tool that I can invoke that records all the
proceedings?
Thanks.
------------------------------
Date: Fri, 6 Apr 2001 23:24:45 +0200
From: "alwin" <alwin@worldmail.nl>
Subject: problem
Message-Id: <9alc97$ffm$1@nereid.worldonline.nl>
hi there,
I 'am building a webside, and I would like to include a database. I do have
a script which allows people to search trough the data base but I wan't to
change this search field in a group of selection fields so my visitors can
select some different options and the data which contains all of the opions
is to be printed out in the browser.
this is the part of the text which I thing has to be changed:
print "<select name=\"searchtext"\ option value=\"cool\" option
value=\"very cool\" option value=\"coolest\"size=1>\n";
print "<BR>Search for documents containing <INPUT type=\"radio\"
name=\"searchtype\" value=\"any\" checked> ANY or <INPUT type=\"radio\"
name=\"searchtype\" value=\"all\"> ALL of these words or phrases.\n";
print "<br>Search only in this Field\n";
print "<SELECT NAME = \"field\">\n";
print "<OPTION value=\"\">\n";
If somebody can help me I would be really thankful
(sorry for my english)
Alwin de Greeff
------------------------------
Date: Fri, 6 Apr 2001 20:42:42 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Question about refcounting
Message-Id: <slrn9csai2.kpv.abigail@tsathoggua.rlyeh.net>
Richard B. Kreckel (Richard.Kreckel@Uni-Mainz.DE) wrote on MMDCCLXXV
September MCMXCIII in <URL:news:9akrvf$hf4$1@bambi.zdv.Uni-Mainz.DE>:
<> Uri Guttman <uri@sysarch.com> wrote:
<> [...]
<> : no, perl doesn't refcount the data, it ref counts variables. x and y are
<> : just strings. it is $e1 and $e2 that are initialized to a ref count of 1
<>
<> Thanks a lot! I had already suspected this. But the book talks
<> explicitly about refcounts of the strings and that is quite
<> confusing (or maybe confused).
Think what happens if Uri is right, and Perl doesn't refcount data:
sub foo {\"bar"}
$foo = foo;
print $$foo;
Perl has to refcount data, and not variables. For lexical variables,
during the compile phase it is known when they can be cleaned up -
when their scope is exited.
Package variables autovivify, and exist till either the program ends,
or they are deleted explicitely.
Abigail
--
$_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; $chop};
$chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
-> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
------------------------------
Date: Fri, 06 Apr 2001 21:26:18 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Question about refcounting
Message-Id: <x7d7apsosl.fsf@home.sysarch.com>
>>>>> "A" == Abigail <abigail@foad.org> writes:
A> Think what happens if Uri is right, and Perl doesn't refcount data:
A> sub foo {\"bar"}
A> $foo = foo;
A> print $$foo;
A> Perl has to refcount data, and not variables. For lexical variables,
A> during the compile phase it is known when they can be cleaned up -
A> when their scope is exited.
abigail is correct. i was crossing wires with the variable itself and
the scalar data it contains. the scalar value has the ref count.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info: http://www.sysarch.com/perl/OOP_class.html
------------------------------
Date: 6 Apr 2001 20:03:31 GMT
From: ajdelore@sfu.ca (Anthony Delorenzo)
Subject: Reverse DNS Lookup
Message-Id: <9al7ej$lpt$1@morgoth.sfu.ca>
Hi...
I'm currently using a small bit of code to do reverse DNS lookup:
my $ip = $ENV{'REMOTE_ADDR'};
my $ip_addr = pack ('C4', (split /\./, $ip) );
my $hostname = gethostbyaddr ($ip_addr,2);
I have two questions about this:
1) I have been unable to find any documentation that can satisfactorily
tell me what the ADDRTYPE argument (the second one supplied to the
gethostbyaddr function) is. I've looked through various man pages and
what not. If anyone can point me to something that will explain this, it
would be great.
I realize it probably has more to do with DNS than perl... The standard
perl documentation doesn't even give an example of the functions use,
however. I found some old code from a 1996 article that led me to use the
value of '2', but I really don't know why or for what.
2) How reliable is gethostbyaddr? It seems to run fine under Unix, but
I've also seen (more complex) scripts that use Net::DNS to perform the
lookups. Is there any reason to prefer one method over the other?
Best Regards,
Tony
--
# Anthony DeLorenzo <ajdelore@sfu.ca>
# Burnaby, BC, Canada
# mojo wire: 209-391-8932
# http://www.sfu.ca/~ajdelore/
------------------------------
Date: Sat, 07 Apr 2001 03:51:47 +0900
From: Kalin Kozhuharov <kalin@thinrope.net>
Subject: Re: Script for downloading Yahoo mail?
Message-Id: <3ACE1043.72A77F@thinrope.net>
Hi, again!
I just got an e-mail reply that solved the whole problem... May be it
wasnt the most approprate newsgroup to post, however.
So the answer is:
1. Subscribe temorary to Yahoo delivers and configure Yahoo mail for
POP3 access.
2. Set your e-mail client to get mail from yahoo.
3. Unsubscribe from delivers, before they even send you one MSG.
I happily downloaded all my mail (2000 MSGs in 23 folders) organized
properly.
Kalin.
--
||///_ o *******************************
||//,_/> WWW: http://ThinRope.Net/
|||\ <"
|||\\ ' *******************************
------------------------------
Date: Fri, 6 Apr 2001 15:21:52 -0400
From: "T_Boss" <T_boss75@curanet.com>
Subject: snmpwalk with perl
Message-Id: <tJoz6.130891$lj4.3976730@news6.giganews.com>
This is a multi-part message in MIME format.
------=_NextPart_000_0053_01C0BEAD.4EE034F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
@r_modem =3D (&snmpwalk( $host, $ip, $Input, $Output));
How can I veriffy if the array @r_modem is empty?
When snmpwalk is not able to locate the host, it has to notify me.
How can this be done?
------=_NextPart_000_0053_01C0BEAD.4EE034F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4308.2900" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>@r_modem =3D (&snmpwalk( $host, =
$ip, $Input,=20
$Output));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>How can I veriffy if the array @r_modem =
is=20
empty?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>When snmpwalk is not able to =
locate the=20
host, it has to notify me.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>How can this be=20
done?</FONT></DIV></FONT></DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0053_01C0BEAD.4EE034F0--
------------------------------
Date: Fri, 6 Apr 2001 22:56:55 +0200
From: "Ludmilla Markowska" <ludmilla.markowska@gmx.net>
Subject: System commands in script
Message-Id: <9alajd$5p5hk$1@ID-81510.news.dfncis.de>
Hi all,
i try to write a webformular to administer our cyrus-imap server. now my
question is how to make system commands like "cyradm localhost" accessible
via a perl-script.
thanks in advance for your help
ludmilla
------------------------------
Date: Fri, 6 Apr 2001 20:49:28 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Time difference
Message-Id: <slrn9csauo.kpv.abigail@tsathoggua.rlyeh.net>
Nick Condon (nickco3@yahoo.DONT-SPAM-ME.co.uk) wrote on MMDCCLXXV
September MCMXCIII in <URL:news:907BAFEADNickCondon@132.146.16.23>:
$$ Waarddebon wrote:
$$
$$ >Hi,
$$ >
$$ >On my site I want to display the difference in time between a file on my
$$ >host and the current time on my host.
$$ >I need to know how I can display the days and hours that are between the
$$ >file and the current time.
$$ >
$$ >Can someone help me out with this one ?
$$
$$ Assuming you mean the file's modification time, stat("filename")[9] will
$$ give you that in seconds since the epoch.
And then there's -M.
Abigail
------------------------------
Date: Fri, 6 Apr 2001 21:05:26 +0100
From: "Milliwave" <milliwave@rfengineering.freeserve.co.uk>
Subject: Re: Using ftell() and fseek()
Message-Id: <9al7dt$2qa$1@news6.svr.pol.co.uk>
Yes, there is a particular reason for doing this, because if I have a large
file, while I would like
to have access to specific lines within a text file over and over again.
for example
one
two
three
my
to
go
the
and so
on
And I would like to jump to these line say "go" and read everything which
follows go,
then I would like the pointer to jump to two and read everythingthing which
follows and so forth
I would appreciate if you could by means of an example inform me
>
>> I would like someone to inform me how I would go about using the
>> above two functions ftell() and fseek() to move within a file
>
>ftell() and fseek() ?? Those are the system calls, but the Perl
>functions are simply tell and seek.
>
>> for example if I want to move to "five" and print everything which
>> follows into another file how would I go about using the above
>> functions in Perl?
>
>'move to "five"' isn't really the type of thing for which you use
>seek. Is there some reason that you want (or need) to solve this
>problem with tell and seek? Otherwise, just use:
>
>[file.txt contents moved to DATA section]
>
>#!/usr/bin/perl
>while (<DATA>) {
> print if /^five$/ .. 0;
>}
>__DATA__
>one
>tow
>ther
>five
>two
>three
>four
>__END__
>
>--
>Ren Maddox
>ren@tivoli.com
------------------------------
Date: Fri, 6 Apr 2001 23:21:49 +0200
From: "alexander gausa" <alexander.gausa@gmx.de>
Subject: win32: *.pl > *.exe howto
Message-Id: <9albok$uhc$03$1@news.t-online.com>
hi!
i want to generate an exe-file from an pl-file.
who knows where to get a comiler, linker and all other tools i need?
regards alex
------------------------------
Date: Fri, 06 Apr 2001 21:52:43 GMT
From: "Dave Brondsema" <brondsem@my-deja.com>
Subject: Re: win32: *.pl > *.exe howto
Message-Id: <LUqz6.145204$W05.28106874@news1.rdc1.mi.home.com>
perl2exe from http://www.indigostar.com/perl2exe.htm
Perlapp:
http://www.activestate.com/ASPN/Reference/Products/PU/Perl%20utilities/PerlA
pp.html
The current issue of Dr. Dobb's Journal has an article about this, also.
"alexander gausa" <alexander.gausa@gmx.de> wrote in message
news:9albok$uhc$03$1@news.t-online.com...
> hi!
> i want to generate an exe-file from an pl-file.
> who knows where to get a comiler, linker and all other tools i need?
> regards alex
>
>
------------------------------
Date: Fri, 06 Apr 2001 13:55:14 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Windows but not UNIX!?
Message-Id: <3ACE1112.5E9CCB20@home.com>
Plastic Fantastic wrote:
>
> ive written a perl script which works fine when I run it through
> the Windows port of perl (perl.exe). When I try to run it through
> UNIX however, it reports some syntax errors and wont run.
Just a guess here, but did you transfer the file to the *nix box via FTP
in ASCII mode? If not, it's probably still in DOS format. If you try to
directly execute a perl script in DOS format on a *nix box, it will
barf. (But running it via 'perl myscript' should work.) Converting the
file format will fix this.
Of course, it's also quite possible that you have an older version of
Perl on the *nix box and it doesn't recognize some of the syntax which
the newer Perl does.
Since you haven't told us *what* the errors were, how are we supposed to
know?
> I dont use the -w switch either time btw.
Why not?
-mjc
------------------------------
Date: Fri, 06 Apr 2001 17:18:20 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: Windows but not UNIX!?
Message-Id: <3ACE329C.13630DCE@patriot.net>
"I've got a vehicle, and it doesn't work. Why not?"
So what do you expect? If you can't be bothered to post the script, then
no one else can be bothered to help you.
Plastic Fantastic wrote:
> hey,
>
> ive written a perl script which works fine when I run it through the Windows
> port of perl (perl.exe). When I try to run it through UNIX however, it
> reports some syntax errors and wont run. I dont use the -w switch either
> time btw.
>
> Any ideas?
>
> Graham
------------------------------
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 V10 Issue 645
**************************************