[22754] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4975 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 12 18:11:00 2003

Date: Mon, 12 May 2003 15:10:22 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 12 May 2003     Volume: 10 Number: 4975

Today's topics:
    Re: egrep exclude (James E Keenan)
    Re: egrep exclude <abigail@abigail.nl>
    Re: egrep exclude <tassilo.parseval@rwth-aachen.de>
        How can I right-justify in a pattern substitution? <bhoppe@ti.com>
    Re: How can I right-justify in a pattern substitution? <ddunham@redwood.taos.com>
    Re: How can I right-justify in a pattern substitution? (Sara)
    Re: How can I right-justify in a pattern substitution? <REMOVEsdnCAPS@comcast.net>
    Re: How can I right-justify in a pattern substitution? <REMOVEsdnCAPS@comcast.net>
    Re: How can I right-justify in a pattern substitution? <usenet@dwall.fastmail.fm>
        In search of elegant code - running code within a large (David Filmer)
    Re: In search of elegant code - running code within a l <glex_nospam@qwest.net>
        Looking for a script (Sascha Carlin)
    Re: Looking for a script <no@spam.for.me.invalid>
    Re: Not able to build perl5.8.0 on Solaris 9 <ewagar@yahoo.com>
        Package for doing log file analysis? (Kenjis Kaan)
    Re: Package for doing log file analysis? <peter_wilson@mail.com>
    Re: Perl code to dump palm datebook? lvirden@yahoo.com
        Question about Net::SMTP <anthony@nospam.safferconsulting.com>
    Re: Question about Net::SMTP <nospam@nospam.de>
    Re: Question about Net::SMTP <mbudash@sonic.net>
        Replying to Posts ( was: Re: check IP address ) <abuse@mweb.co.za>
    Re: Replying to Posts ( was: Re: check IP address ) (James E Keenan)
    Re: retrieve actuate report from the web (Samara)
    Re: retrieve actuate report from the web <cwilbur@mithril.chromatico.net>
    Re: Try to find a hash element but no luck (Anno Siegel)
    Re: Try to find a hash element but no luck <REMOVEsdnCAPS@comcast.net>
        using CPAN.pm for local installs w/dependencies <mbudash@sonic.net>
    Re: XML::DOM parsing error (Robert Shaffer)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 12 May 2003 09:29:20 -0700
From: jkeen@concentric.net (James E Keenan)
Subject: Re: egrep exclude
Message-Id: <b955da04.0305120829.1885e1fd@posting.google.com>

patyoung13@hotmail.com (Herb Burnswell) wrote in message news:<3b38898e.0305112012.7af3e9b8@posting.google.com>...
> Hi All,
> 
> I am a novice programmer and have been trying to figure out the best
> way to approach the following issue.  I have a perl script that checks
> nightly build logs for all of our build platforms.  It's pretty simple
> but I would like to add to it.  Right now I do a:
> 
> chdir $builddir;
> 
> 	$commandline = "find . -type f -name *.log | xargs egrep -i error";
> 	system ($commandline); 
> 
At the risk of being accused of not answering your question directly,
I'd like to ask:  Why are you running a Perl script which ends up
going out to the shell when you could accomplish everything you want
entirely inside Perl?

Sitting at a Windows terminal, I don't have the opportunity to test
out your shell command or look up the man pages.  So I can't write and
test the Perl script that would be the answer to your needs.  But I'd
guess that the Perl features that would be relevant to you would
include:
1.  File::Find -- a module that comes standard with Perl; access
documentation thru 'perldoc File::Find'
2.  file test operators; 'perldoc -f -f'
3.  TIMTOWTDI:  multiple ways to get a list of files in a directory;
'perldoc -f glob'; 'perldoc -f readdir'
4.  Perl's 'grep' function:  differs in certain aspects from the
shell's; perldoc -f grep


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

Date: 12 May 2003 20:03:20 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: egrep exclude
Message-Id: <slrnbbvvg8.f7.abigail@alexandra.abigail.nl>

James E Keenan (jkeen@concentric.net) wrote on MMMDXLI September MCMXCIII
in <URL:news:b955da04.0305120829.1885e1fd@posting.google.com>:
^^  patyoung13@hotmail.com (Herb Burnswell) wrote in message news:<3b38898e.0305112012.7af3e9b8@posting.google.com>...
^^ > Hi All,
^^ > 
^^ > I am a novice programmer and have been trying to figure out the best
^^ > way to approach the following issue.  I have a perl script that checks
^^ > nightly build logs for all of our build platforms.  It's pretty simple
^^ > but I would like to add to it.  Right now I do a:
^^ > 
^^ > chdir $builddir;
^^ > 
^^ > 	$commandline = "find . -type f -name *.log | xargs egrep -i error";
^^ > 	system ($commandline); 
^^ > 
^^  At the risk of being accused of not answering your question directly,
^^  I'd like to ask:  Why are you running a Perl script which ends up
^^  going out to the shell when you could accomplish everything you want
^^  entirely inside Perl?

As someone who regulary "shells" out to the Unix toolbox, is there 
something fundamentally wrong with shelling out? Would you complain
as well if someone is using the DBI because that's using compiled C,
instead of doing it all in Perl?

^^  Sitting at a Windows terminal, I don't have the opportunity to test
^^  out your shell command or look up the man pages.  So I can't write and
^^  test the Perl script that would be the answer to your needs.

That seems a poor reason to me to not shell out.


Abigail
-- 
$_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; $chop};
$chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
-> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()


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

Date: 12 May 2003 20:43:33 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: egrep exclude
Message-Id: <b9p11l$8he$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Abigail:

> James E Keenan (jkeen@concentric.net) wrote on MMMDXLI September MCMXCIII
> in <URL:news:b955da04.0305120829.1885e1fd@posting.google.com>:
> ^^  patyoung13@hotmail.com (Herb Burnswell) wrote in message news:<3b38898e.0305112012.7af3e9b8@posting.google.com>...

> ^^ > chdir $builddir;
> ^^ > 
> ^^ > 	$commandline = "find . -type f -name *.log | xargs egrep -i error";
> ^^ > 	system ($commandline); 
> ^^ > 
> ^^  At the risk of being accused of not answering your question directly,
> ^^  I'd like to ask:  Why are you running a Perl script which ends up
> ^^  going out to the shell when you could accomplish everything you want
> ^^  entirely inside Perl?
> 
> As someone who regulary "shells" out to the Unix toolbox, is there 
> something fundamentally wrong with shelling out? Would you complain
> as well if someone is using the DBI because that's using compiled C,
> instead of doing it all in Perl?

The problem with shelling out is not that it involves compiled C. On the
contrary, if I can choose between a module written in pure Perl and one
containing XS-portions I usually go for the latter for the sake of
performance (provided that the XS module is as convenient as the Perl
one).

If you invoke the shell from Perl you need a better reason than stating
that you do it "regularly". A 'qx!cp * /tmp!' could be either quicker or
(or even and) more convenient than using File::Copy so why not? But an
egrep task is Perl's realm. You have more powerful regexes, save the
spawning of a new process, remain portable etc.

> ^^  Sitting at a Windows terminal, I don't have the opportunity to test
> ^^  out your shell command or look up the man pages.  So I can't write and
> ^^  test the Perl script that would be the answer to your needs.
> 
> That seems a poor reason to me to not shell out.

I think it's a good reason. Why should he shell out an egrep thing if
his shell couldn't handle it?

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


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

Date: Mon, 12 May 2003 13:08:04 -0500
From: Brandon Hoppe <bhoppe@ti.com>
Subject: How can I right-justify in a pattern substitution?
Message-Id: <b9onu4$b92$1@home.itg.ti.com>


I have this pattern substitution:

s/\|/\| $row \| $blk \| $col \|/;

Is there a way I can justify this so that it looks like this:

| 132 |   3 |  27 |
| 172 |  23 |   2 |
etc




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

Date: Mon, 12 May 2003 18:35:09 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: How can I right-justify in a pattern substitution?
Message-Id: <xPRva.25$8s4.5190788@newssvr14.news.prodigy.com>

Brandon Hoppe <bhoppe@ti.com> wrote:

> I have this pattern substitution:

> s/\|/\| $row \| $blk \| $col \|/;

> Is there a way I can justify this so that it looks like this:

> | 132 |   3 |  27 |
> | 172 |  23 |   2 |

"justification" and "substitution" are difficult to put together.  You
might want to do something else.

If your pipe is always in the same place, something like this can work.

$target = "|";
$replacement = sprintf ("|%4u |%4u |%4u |", $row, $blk, $col);
$variable =~ s/\Q$target\E/$replacement/;

-- 
Darren Dunham                                           ddunham@taos.com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >


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

Date: 12 May 2003 13:32:23 -0700
From: genericax@hotmail.com (Sara)
Subject: Re: How can I right-justify in a pattern substitution?
Message-Id: <776e0325.0305121232.1b0c9329@posting.google.com>

Brandon Hoppe <bhoppe@ti.com> wrote in message news:<b9onu4$b92$1@home.itg.ti.com>...
> I have this pattern substitution:
> 
> s/\|/\| $row \| $blk \| $col \|/;
> 
> Is there a way I can justify this so that it looks like this:
> 
> | 132 |   3 |  27 |
> | 172 |  23 |   2 |
> etc

You may want to try using tabs if you're not too concerned that all
columns are the same width, like:

   s/\|\s*(\d+)\s*/\|\t$1\t/g;

-Gx


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

Date: Mon, 12 May 2003 16:18:11 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: How can I right-justify in a pattern substitution?
Message-Id: <Xns9379AFF41CA43sdn.comcast@216.166.71.239>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

genericax@hotmail.com (Sara) wrote in
news:776e0325.0305121232.1b0c9329@posting.google.com: 

> Brandon Hoppe <bhoppe@ti.com> wrote in message
> news:<b9onu4$b92$1@home.itg.ti.com>... 
>> I have this pattern substitution:
>> 
>> s/\|/\| $row \| $blk \| $col \|/;
>> 
>> Is there a way I can justify this so that it looks like this:
>> 
>> | 132 |   3 |  27 |
>> | 172 |  23 |   2 |
>> etc
> 
> You may want to try using tabs if you're not too concerned that all
> columns are the same width, like:
> 
>    s/\|\s*(\d+)\s*/\|\t$1\t/g;

Tabs left-justify, not right-justify.

- -- 
Eric
print scalar reverse sort qw p ekca lre reh 
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13

iD8DBQE+wA96Y96i4h5M0egRAi7GAKDwpkoyzBz4udc49YOxOQsMQyWydgCdEq/B
/v4dj3Pd0QzttNrRgHJZeoY=
=LXs4
-----END PGP SIGNATURE-----


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

Date: Mon, 12 May 2003 16:21:38 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: How can I right-justify in a pattern substitution?
Message-Id: <Xns9379B08A1EB83sdn.comcast@216.166.71.239>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

Brandon Hoppe <bhoppe@ti.com> wrote in news:b9onu4$b92$1@home.itg.ti.com:

> 
> I have this pattern substitution:
> 
> s/\|/\| $row \| $blk \| $col \|/;
> 
> Is there a way I can justify this so that it looks like this:
> 
>| 132 |   3 |  27 |
>| 172 |  23 |   2 |

Try s/\|/ sprintf "|%4s |%4s |%4s |",$row,$blk,$col/e;

- -- 
Eric
print scalar reverse sort qw p ekca lre reh 
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13

iD8DBQE+wBBKY96i4h5M0egRAhI1AJ4jSDgACYJVXt93Sf2ABNxj3e/v/QCfRjMR
mjdl/Mo0qHVJh6PwCo4p5A4=
=K2sN
-----END PGP SIGNATURE-----


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

Date: Mon, 12 May 2003 21:40:37 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: How can I right-justify in a pattern substitution?
Message-Id: <Xns9379B3D213640dkwwashere@216.168.3.30>

Eric J. Roode <REMOVEsdnCAPS@comcast.net> wrote:

> Brandon Hoppe <bhoppe@ti.com> wrote in
> news:b9onu4$b92$1@home.itg.ti.com: 
> 
>> 
>> I have this pattern substitution:
>> 
>> s/\|/\| $row \| $blk \| $col \|/;
>> 
>> Is there a way I can justify this so that it looks like this:
>> 
>>| 132 |   3 |  27 |
>>| 172 |  23 |   2 |
> 
> Try s/\|/ sprintf "|%4s |%4s |%4s |",$row,$blk,$col/e;

I'm not sure why I bothered, but in the spirit of TMTOWTDI, here's a 
variation. (in case there are more than three columns, I guess)


    $_ = '|';
    my ($row, $blk, $col, $other) = (132, 3, 27, 1234);
    s/\|/f(' %4d ',$row, $blk, $col, $other)/e;
    print;

    sub f {
        my $formstr = shift;
        @_ = map { sprintf $formstr, $_ } @_;
        return '|' . join('|', @_) . '|';
    }



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

Date: 12 May 2003 14:07:20 -0700
From: IneverReadAnythingSentToMe@hotmail.com (David Filmer)
Subject: In search of elegant code - running code within a larger Print stmt
Message-Id: <e4c916dd.0305121307.4c3d0270@posting.google.com>

(this example refers to CGI.pm functions, but could be generalized)...

I'm creating a webform, and want to include ten upload fields (created
with CGI.pm's 'filefield' function).  I can do something like this:

   for (1..10) {push @TEMP, filefield(-name => 'file')};

   print
      table({...},  #a CGI.pm function
      ...
      @TEMP,        #include previously created tags - YUCK!
      ...
      );   #end table definition and print statement
 
I would prefer to imbed the code within the print statement (and
within the table function) like this:

   print
      table({...},  #a CGI.pm function
      ...
      ${for (1..10) {print filefield(-name => 'file')}},
      ...
      );   #end table definition and print statement

It does not work as desired, because the interpreter resolves the
imbedded print statement before it can resolve the larger print
statement, so my filefields print at the top of my document instead of
where I want them to go.

How can I properly embed the code within the larger print statement?


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

Date: Mon, 12 May 2003 16:29:22 -0500
From: "J. Gleixner" <glex_nospam@qwest.net>
Subject: Re: In search of elegant code - running code within a larger Print stmt
Message-Id: <%iUva.474$VF3.57199@news.uswest.net>


> How can I properly embed the code within the larger print statement?

By using map.  Take a look at some of Randal's old columns from 
WebTechniques.  Such as the show_form() in:

http://www.stonehenge.com/merlyn/WebTechniques/col38.html

That's probably exactly what you want, just need to change the CGI.pm 
method that's called.

See ya



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

Date: 12 May 2003 06:46:38 -0700
From: sc@itst.org (Sascha Carlin)
Subject: Looking for a script
Message-Id: <caa39ab2.0305120546.49b9523c@posting.google.com>

Hi all ;-)

I'm looking for a script that crawls through all subdirectories,
creating index-files (HTML) for each subdirectory with links to all
files in them. It should also link all created files so that a user
can browse through the directories.

Too me this sound like a common task so I don't want to reinvent the
wheel ;-)

Any pointers?

Regards, Sascha


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

Date: Mon, 12 May 2003 14:53:47 GMT
From: "Nils Petter Vaskinn" <no@spam.for.me.invalid>
Subject: Re: Looking for a script
Message-Id: <pan.2003.05.12.14.53.48.249732@spam.for.me.invalid>

On Mon, 12 May 2003 06:46:38 -0700, Sascha Carlin wrote:

> Hi all ;-)

> Any pointers?


http://www.google.com/search?&q=generate+html+directory+tree


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

Date: Mon, 12 May 2003 19:55:42 GMT
From: "Eric Wagar" <ewagar@yahoo.com>
Subject: Re: Not able to build perl5.8.0 on Solaris 9
Message-Id: <2%Sva.579698$Zo.126330@sccrnsc03>

This was resolved by reading further into the INSTALL file.  There is a
mention about inet problems.  Evidently, after my recent reinstall, I
reinstalled the BIND binaries, etc, when I didn't think I did.

Oh well, It's working now.

e


"Eric Wagar" <ewagar@yahoo.com> wrote in message
news:xPAva.808774$3D1.453262@sccrnsc01...
> When I try to 'make test' on my Sun Netra running Solaris 9 (fully
patched),
> I get errors like this:
> fatal: relocation error: file ../lib/auto/Socket/Socket.so: symbol
> inet_aton: referenced symbol not found
>
> Of course, this doesn't stop perl from installing, but it kinda hampers
> stuff like CPAN (among other things I want to be doing.)
>
> I haven't been able to find much of anything on the web, except that maybe
> changing my LD_LIBRARY_PATH around, which I did.  I added /usr/lib.  My
> ./myconfig is at the end.
>
> Any help is greatly enjoyed and appreciated.
>
> thanks
> eric
>
> Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
>   Platform:
>     osname=solaris, osvers=2.9, archname=sun4-solaris
>     uname='sunos guy 5.9 generic_112233-05 sun4u sparc
> sunw,ultrasparc-iii-cengine '
>     config_args='-de -Ubincompat5005'
>     hint=recommended, useposix=true, d_sigaction=define
>     usethreads=undef use5005threads=undef useithreads=undef
> usemultiplicity=undef
>     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
>     use64bitint=undef use64bitall=undef uselongdouble=undef
>     usemymalloc=n, bincompat5005=undef
>   Compiler:
>     cc='gcc', ccflags
> ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
>     optimize='-O',
>     cppflags='-fno-strict-aliasing'
>     ccversion='', gccversion='3.2.3', gccosandvers='solaris2.9'
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
>     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
>     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
> lseeksize=8
>     alignbytes=8, prototype=define
>   Linker and Libraries:
>     ld='gcc', ldflags =' -L/usr/local/lib '
>     libpth=/usr/local/lib /usr/lib /usr/ccs/lib
>     libs=-lsocket -lbind -lnsl -ldl -lm -lc
>     perllibs=-lsocket -lbind -lnsl -ldl -lm -lc
>     libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
>     gnulibc_version=''
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
>     cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'
>
>




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

Date: 12 May 2003 06:28:43 -0700
From: tivolinewbie@canada.com (Kenjis Kaan)
Subject: Package for doing log file analysis?
Message-Id: <6a8ba9f8.0305120528.6b71187f@posting.google.com>

What are good perl packages for doing log file analysis?
For example log files such as those having the format of *.ini files
in c:\winnt\ directory?

What about for analysis other log file format.  By analysis I mean the
ability to parse the file for desired tokens, and to see the instance
of occurrences of each token etc etc   Thanks in advance


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

Date: Mon, 12 May 2003 15:51:47 +0000 (UTC)
From: "Peter Wilson" <peter_wilson@mail.com>
Subject: Re: Package for doing log file analysis?
Message-Id: <b9ofuj$6o3$1@hercules.btinternet.com>


"Kenjis Kaan" <tivolinewbie@canada.com> wrote in message
news:6a8ba9f8.0305120528.6b71187f@posting.google.com...
> What are good perl packages for doing log file analysis?
> For example log files such as those having the format of *.ini files
> in c:\winnt\ directory?
>
> What about for analysis other log file format.  By analysis I mean the
> ability to parse the file for desired tokens, and to see the instance
> of occurrences of each token etc etc   Thanks in advance

Hi

Take a look at

Config::Auto

I find its pretty great. There are other ways of course

Config::Ini
Config::IniFiles

you will find the modules www.cpan.org

Pete




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

Date: 12 May 2003 17:01:50 GMT
From: lvirden@yahoo.com
Subject: Re: Perl code to dump palm datebook?
Message-Id: <b9ok1u$ga6$3@srv38.cas.org>


According to  <joe@jolomo.net>:
:Does anyone have some perl code that will take the datebook.dat
:file from the palm hot-sync and output the entries in a log format

You might check
Palm::PunchClock 
or
Palm::Timesheet 
and see if either of these have code you could use.

Also, take a look at PilotManager - it has code which parses the databook
data and then uses the results to compare against Sun's Calendar Manager.
Perhaps you could extract the parsing code.


-- 
The Tenth Annual Tcl/Tk Conference <URL: http://www.tcl.tk/community/tcl2003 >
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
<URL: mailto:lvirden@yahoo.com > <URL: http://www.purl.org/NET/lvirden/ >


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

Date: Mon, 12 May 2003 08:43:50 -0500
From: "Anthony Saffer" <anthony@nospam.safferconsulting.com>
Subject: Question about Net::SMTP
Message-Id: <3ebfa56d_2@nntp2.nac.net>

Hello Everyone,

I'm having trouble with Net::SMTP and am, once again, turning to you guys
for help. I have the following code:

#!/usr/local/bin/perl -w
    use Net::SMTP;
    $smtp = Net::SMTP->new('smtp.junct.com',
       Hello=>'junct.com');


    $smtp->data();
    $smtp->datasend("From: Tester <just\@tester.com>\n");
    $smtp->datasend("To: anthony\@safferconsulting.com\n");
    $smtp->datasend("Subject: A test of SMTP\n");
    $smtp->datasend("This is a test");
 $smtp->dataend();
 $smtp->quit();
 print "Mail Sent\n";

The program actually makes a connection to my SMTP server (smtp.junct.com)
and sends SOMETHING. But I never get the mail. Can anyone tell me what's
wrong with this code or is there a problem with the SMTP server?

Thanks!
Anthony





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

Date: Mon, 12 May 2003 16:53:14 +0200
From: "Thomas Kratz" <nospam@nospam.de>
Subject: Re: Question about Net::SMTP
Message-Id: <3ebfbd53.0@juno.wiesbaden.netsurf.de>

DQoiQW50aG9ueSBTYWZmZXIiIDxhbnRob255QG5vc3BhbS5zYWZmZXJjb25zdWx0aW5nLmNvbT4g
d3JvdGUuLi4NCj4gSGVsbG8gRXZlcnlvbmUsDQo+IA0KPiBJJ20gaGF2aW5nIHRyb3VibGUgd2l0
aCBOZXQ6OlNNVFAgYW5kIGFtLCBvbmNlIGFnYWluLCB0dXJuaW5nIHRvIHlvdSBndXlzDQo+IGZv
ciBoZWxwLiBJIGhhdmUgdGhlIGZvbGxvd2luZyBjb2RlOg0KPiANCj4gIyEvdXNyL2xvY2FsL2Jp
bi9wZXJsIC13DQo+ICAgICB1c2UgTmV0OjpTTVRQOw0KPiAgICAgJHNtdHAgPSBOZXQ6OlNNVFAt
Pm5ldygnc210cC5qdW5jdC5jb20nLA0KPiAgICAgICAgSGVsbG89PidqdW5jdC5jb20nKTsNCj4g
DQo+IA0KPiAgICAgJHNtdHAtPmRhdGEoKTsNCj4gICAgICRzbXRwLT5kYXRhc2VuZCgiRnJvbTog
VGVzdGVyIDxqdXN0XEB0ZXN0ZXIuY29tPlxuIik7DQo+ICAgICAkc210cC0+ZGF0YXNlbmQoIlRv
OiBhbnRob255XEBzYWZmZXJjb25zdWx0aW5nLmNvbVxuIik7DQo+ICAgICAkc210cC0+ZGF0YXNl
bmQoIlN1YmplY3Q6IEEgdGVzdCBvZiBTTVRQXG4iKTsNCj4gICAgICRzbXRwLT5kYXRhc2VuZCgi
VGhpcyBpcyBhIHRlc3QiKTsNCj4gICRzbXRwLT5kYXRhZW5kKCk7DQo+ICAkc210cC0+cXVpdCgp
Ow0KPiAgcHJpbnQgIk1haWwgU2VudFxuIjsNCj4gDQo+IFRoZSBwcm9ncmFtIGFjdHVhbGx5IG1h
a2VzIGEgY29ubmVjdGlvbiB0byBteSBTTVRQIHNlcnZlciAoc210cC5qdW5jdC5jb20pDQo+IGFu
ZCBzZW5kcyBTT01FVEhJTkcuIEJ1dCBJIG5ldmVyIGdldCB0aGUgbWFpbC4gQ2FuIGFueW9uZSB0
ZWxsIG1lIHdoYXQncw0KPiB3cm9uZyB3aXRoIHRoaXMgY29kZSBvciBpcyB0aGVyZSBhIHByb2Js
ZW0gd2l0aCB0aGUgU01UUCBzZXJ2ZXI/DQoNCkZpcnN0IHlvdSBzaG91bGQgKmFsd2F5cyogY2hl
Y2sgdGhlIHJldHVybiB2YWx1ZXMgb2YgdGhlIG1ldGhvZCBjYWxscy4NClRoZW4geW91J2Qga25v
dyB3aGVyZSB0aGUgZXJyb3Igb2NjdXJzIGV4YWN0bHkuDQoNCkZvciBkZWJ1Z2dpbmcgcHVycG9z
ZXMgeW91IHNob3VsZCBjaGFuZ2UgdGhlIGNvbnN0cnVjdG9yIGNhbGwgdG8NCg0KJHNtdHAgPSBO
ZXQ6OlNNVFAtPm5ldygNCiAgICdzbXRwLmp1bmN0LmNvbScsDQogICBIZWxsbyA9PiAnanVuY3Qu
Y29tJywNCiAgIERlYnVnID0+IDEsDQopOw0KDQpUaGlzIGR1bXBzIHRoZSBjb21wbGV0ZSBjb21t
dW5pY2F0aW9uIHRvIFNUREVSUi4NCg0KRm9yIGRldGFpbHMgcmVhZCB0aGUgZG9jcyAocGVybGRv
YyBOZXQ6OlNNVFApLA0KYnV0IHlvdSBkaWQgdGhhdCBhbHJlYWR5ICwgZGlkIHlvdT8gOy0pDQoN
ClRob21hcw==



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

Date: Mon, 12 May 2003 17:31:49 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Question about Net::SMTP
Message-Id: <mbudash-09EB44.10315012052003@typhoon.sonic.net>

In article <3ebfa56d_2@nntp2.nac.net>,
 "Anthony Saffer" <anthony@nospam.safferconsulting.com> wrote:

> Hello Everyone,
> 
> I'm having trouble with Net::SMTP and am, once again, turning to you guys
> for help. I have the following code:
> 
> #!/usr/local/bin/perl -w
>     use Net::SMTP;
>     $smtp = Net::SMTP->new('smtp.junct.com',
>        Hello=>'junct.com');
> 
> 
>     $smtp->data();
>     $smtp->datasend("From: Tester <just\@tester.com>\n");
>     $smtp->datasend("To: anthony\@safferconsulting.com\n");
>     $smtp->datasend("Subject: A test of SMTP\n");

never having used Net::SMTP, this is just a guess, but try adding this:

     $smtp->datasend("\n");

>     $smtp->datasend("This is a test");
>  $smtp->dataend();
>  $smtp->quit();
>  print "Mail Sent\n";
> 
> The program actually makes a connection to my SMTP server (smtp.junct.com)
> and sends SOMETHING. But I never get the mail. Can anyone tell me what's
> wrong with this code or is there a problem with the SMTP server?
> 
> Thanks!
> Anthony
> 
> 
> 

hth-

-- 
Michael Budash


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

Date: Mon, 12 May 2003 20:49:10 +0200
From: "Nico Coetzee" <abuse@mweb.co.za>
Subject: Replying to Posts ( was: Re: check IP address )
Message-Id: <pan.2003.05.12.18.49.07.450448@mweb.co.za>

I was told in a previous post that I should top-post.

Which is it now? Does this ng have a FAQ?

Maybe we should have this link available in the weekly stats run?

Thanks

On Mon, 12 May 2003 02:19:26 +0000, Martien Verbruggen wrote:

> [Please, do not top-post]
> 
> Martien
---snip---

-- 
Nico Coetzee

http://www.itfirms.co.za/
http://za.pm.org/
http://forums.databasejournal.com/

To the systems programmer, users and applications serve only to provide a
test load.



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

Date: 12 May 2003 14:51:29 -0700
From: jkeen@concentric.net (James E Keenan)
Subject: Re: Replying to Posts ( was: Re: check IP address )
Message-Id: <b955da04.0305121351.1b6577fc@posting.google.com>

"Nico Coetzee" <abuse@mweb.co.za> wrote in message news:<pan.2003.05.12.18.49.07.450448@mweb.co.za>...
> I was told in a previous post that I should top-post.
>

Wrong.  Bottom-post is correct style. 
> Which is it now? Does this ng have a FAQ?

http://groups.google.com/groups?q=+%22Posting+Guidelines%22+group:comp.lang.perl.misc&hl=en&lr=&ie=UTF-8&oe=UTF-8&scoring=d&selm=ddidnQu1yrChyiajXTWcoA%40august.net&rnum=6


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

Date: 12 May 2003 13:26:07 -0700
From: prokurator@aol.com (Samara)
Subject: Re: retrieve actuate report from the web
Message-Id: <d45e82a2.0305121226.4419a854@posting.google.com>

I know it but for some reason I am getting all the time response: 
'Can't connect to www.site_name.com:443 (Timeout)'

Thanks.


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

Date: Mon, 12 May 2003 21:12:54 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: retrieve actuate report from the web
Message-Id: <87el33eusl.fsf@mithril.chromatico.net>

prokurator@aol.com (Samara) writes:

> I know it but for some reason I am getting all the time response: 
> 'Can't connect to www.site_name.com:443 (Timeout)'

Perhaps because it doesn't exist?

bash-2.05b$ nslookup www.site_name.com
Server:  mithril.chromatico.net
Address:  192.168.1.1

*** mithril.chromatico.net can't find www.site_name.com: 
  Non-existent host/domain

Charlton



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

Date: 12 May 2003 13:09:06 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Try to find a hash element but no luck
Message-Id: <b9o6di$qm6$1@mamenchi.zrz.TU-Berlin.DE>

Sara <genericax@hotmail.com> wrote in comp.lang.perl.misc:
> "David G" <DavidG997@yahoo.com> wrote in message
> news:<b9m3i8$kq6ut$1@ID-82947.news.dfncis.de>...
> > I have a defined hash loaded as follows:
> > 
>  .
>  .
> 
> > 
> > if (exists $database{$inphost})
> > {
> >   print "\nfound hash element\n";
> >   }
> > else
> > {
> >   print "\nHash element not found\n";
> > }
> >  Will using the large C and not the small c casue this ?
> > If not how to do I find it ?
> > 
> > TIA
> 
> 
> I always use 
> 
>   if defined $h{element}
> 
> Which seem to work as I'd expect in every case. When I first learned
> Perl I used "exists" but abandoned it when I discovered that it seemed
> to be a subset of "defined".
> 
> Why does "exists" exist?

It distinguishes the case that a key exists in a hash, but its value
happens to be undefined.  This may look like a marginal difference,
but it is essential in some cases.

Exists can also be applied to arrays and even subroutines to make
similar subtle distinctions.  "perldoc -f exists" for the full story,
but you knew that...

Anno


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

Date: Mon, 12 May 2003 16:26:04 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Try to find a hash element but no luck
Message-Id: <Xns9379B149EE80Bsdn.comcast@216.166.71.239>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

genericax@hotmail.com (Sara) wrote in
news:776e0325.0305120436.4995d04@posting.google.com: 

> 
> I always use 
> 
>   if defined $h{element}
> 
> Which seem to work as I'd expect in every case. When I first learned
> Perl I used "exists" but abandoned it when I discovered that it seemed
> to be a subset of "defined".
> 
> Why does "exists" exist?


$h{element} = undef;

Now $h{element} exists, but it's undefined.

- -- 
Eric
print scalar reverse sort qw p ekca lre reh 
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13

iD8DBQE+wBFSY96i4h5M0egRAs5NAJ9SdIJLkoVj+6hrD+MoIGez+Ye9BwCfaQXf
rEReabxu/dEmYOzEuwfl99I=
=8Mxt
-----END PGP SIGNATURE-----


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

Date: Mon, 12 May 2003 19:48:51 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: using CPAN.pm for local installs w/dependencies
Message-Id: <mbudash-1CF32B.12485012052003@typhoon.sonic.net>

hey all -

can somebody refresh my memory on using CPAN.pm to do local installs 
w/dependencies? i've been doing the following, but often i get errors 
saying the dependended-upon modules can't be found, even though they're 
being installed along the way:

perl -MCPAN -e shell

cpan> o conf makepl_arg PREFIX=/path/to/my/install/dir


i can give more info if needed...

-- 
Michael Budash


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

Date: 12 May 2003 11:37:04 -0700
From: qwickfire@hotmail.com (Robert Shaffer)
Subject: Re: XML::DOM parsing error
Message-Id: <3f1bb9b8.0305121037.4a51150f@posting.google.com>

Thank you for your reply.
the code I ended up using was:

foreach my $elem ($doc->getElementsByTagName("cimple")){
		my $parent = $elem->getParentNode();
		my $field = $elem->getFirstChild->getValue();
		my $value = $self->{$field};
		$parent->removeChild($elem);
		if( defined($value) ) {
			$parent->addText($value); # addText is a non-DOM extension in
XML::DOM
		} else {
		warn "No defined value for field \"$field\"";
		}
}
Cimple! although I don't deserve the credit!
The program is going to be free software to aid in metadata
conversion.
This sort of template thing only works well for converting to simple
metadata schemas like Dublin Core though. If I was producing a MARC
template it is difficult to mark the attributes i.e. <marcfield
a="foo" b="bar" c="FIELDNAME"> without limiting the fixed text such as
foo and bar.
Can you think of any way to do this...or given that $self is the
address of a blessed hash with self->{FIELDNAME} as one of the keys
would it be better to pass the name of a DC or MARC XML generating
function and eval() it to generate new XML based on the field names in
$self?


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

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


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