[19088] in Perl-Users-Digest
Perl-Users Digest, Issue: 1283 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 11 09:05:53 2001
Date: Wed, 11 Jul 2001 06:05:30 -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: <994856729-v10-i1283@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 11 Jul 2001 Volume: 10 Number: 1283
Today's topics:
"Make" executable? (Garry)
Re: "Make" executable? <Florian.Albrecht@alcatel.de>
Re: "Make" executable? (Jay Tilton)
Re: "Make" executable? <newspost@coppit.org>
Creating an HTML Template <Obsidian_Draco@c4.com>
Re: double key for hashtable <m.grimshaw@salford.ac.uk>
Emacs modules for Perl programming (Jari Aalto+mail.perl)
Re: environment variable in cgi <gnarinn@hotmail.com>
FAQ: Is there an ISO or ANSI certified version of Perl? <faq@denver.pm.org>
Re: no pragma in loop nobull@mail.com
Re: Odd scalar equality problem (Vassilis Rigas)
Re: Performance problem--memory bloat or crawl <Thomas@Baetzler.de>
Re: Perl Newbie - problem with NTFS and readdir (Garry)
Re: Perl will only work by double clicking script it wo <joe@bloggs.com>
Re: Perl will only work by double clicking script it wo <pne-news-20010711@newton.digitalspace.net>
Perl/Sendmail not sending mail? (el)
Re: Perl/Sendmail not sending mail? (Rafael Garcia-Suarez)
Problem with install packade (parser.pm error) (Aleksey)
Re: problems with Apache and DBI (Oracle) <gnarinn@hotmail.com>
Re: regular expression ??? nobull@mail.com
Re: Some perl questions <laszlo.gerencser@portologic.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Jul 2001 02:17:26 -0700
From: garry_short@hotmail.com (Garry)
Subject: "Make" executable?
Message-Id: <bdcefd33.0107110117.2f84e065@posting.google.com>
Hiya.
Could anyone tell me where I can download a perl-compatible "make"
executable from? I'm running ActiveState Perl 5.6.0, build 618, and a
search of the system doesn't find a "make" command (or nmake, or
omake, or any executable with make in it)!
I've tried posting a message to ActiveState, but that was several days
ago and they've yet to respond.
I've also tried "clearmake", the make command that comes with
ClearCase, but it always throws up an error right at the end of the
makefile script. The last three lines are :
$(PM_TO_BLIB)
<<
@$(TOUCH) $@
and it complains about the middle line (I'm trying to install modules,
btw).
So ... perl-compatible "make" exe, anyone?
Cheers,
Garry
------------------------------
Date: Wed, 11 Jul 2001 12:21:49 +0200
From: Florian Albrecht <Florian.Albrecht@alcatel.de>
Subject: Re: "Make" executable?
Message-Id: <3B4C28BD.7E985594@alcatel.de>
Hey Gary!
> Could anyone tell me where I can download a perl-compatible "make"
> executable from? I'm running ActiveState Perl 5.6.0, build 618, and a
> search of the system doesn't find a "make" command (or nmake, or
> omake, or any executable with make in it)!
I suppose you want to "make" some modules or something! The problem you
have is that ActiveState Perl is compiled with MSVC++ 6 and all modules
(or whatever) have also to be compiled with VC++ 6.
Now you got several possibilities:
1. You get MSVC++ 6 which includes nmake! or
2. You get the source of perl and make it with an other make, e.g.
cygwin! or
3. You change your OS and don't have to use the MS Compiler.
Good Luck!
;-) Flo
--
KMR=26.27
Powered by KMCount ;)
------------------------------
Date: Wed, 11 Jul 2001 12:16:57 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: "Make" executable?
Message-Id: <3b4c4284.125782899@news.erols.com>
On 11 Jul 2001 02:17:26 -0700, garry_short@hotmail.com (Garry) wrote:
>Could anyone tell me where I can download a perl-compatible "make"
>executable from? I'm running ActiveState Perl 5.6.0, build 618, and a
>search of the system doesn't find a "make" command (or nmake, or
>omake, or any executable with make in it)!
Instructions for installing modules, including a link to obtain nmake, can
be found in the file ActivePerl-Winfaq9.html, included with the standard
Activestate Perl documentation. Look under the headings "How can I use
modules from CPAN?" and "Where do I get make for Win32?"
FWIW, dmake will also work for this purpose if you change the line
make='nmake'
to
make='dmake'
in the Config.pm file.
------------------------------
Date: Wed, 11 Jul 2001 08:38:56 -0400
From: David Coppit <newspost@coppit.org>
Subject: Re: "Make" executable?
Message-Id: <3B4C48E0.7060009@coppit.org>
Garry wrote:
> Could anyone tell me where I can download a perl-compatible "make"
> executable from? I'm running ActiveState Perl 5.6.0, build 618, and a
> search of the system doesn't find a "make" command (or nmake, or
> omake, or any executable with make in it)!
Believe it or not, Microsoft has a free binary you can download and use.
See:
http://www.geocities.com/gerardlanois/perl/20000706_000001.html
David
------------------------------
Date: Wed, 11 Jul 2001 12:30:06 -0000
From: Blu_Haze <Obsidian_Draco@c4.com>
Subject: Creating an HTML Template
Message-Id: <tkohme694uka1b@corp.supernews.com>
I'm designing a web site ( http://TeamAngelus.tripod.com ) and I've got
the layout so the only thing I need to edit for each page is at the very
bottom of the HTML source code. Basically everything is laid out in
tables, being a table at the top for the banner, a table at the left for
the nav, a table at the right for the quicklinks, and the middle table for
the editable content.
Eveything but the middle table stays the same until I make an update for
the left or right tables. And everything is used as the same template for
each page, meaning when I change something in the left or right tables, I
have to change it for every single page or I'll have blind links. I need a
way to be able to change it once, and have it effect every page.
Any help would be greatly appreciated.
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: Wed, 11 Jul 2001 09:00:22 +0100
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: double key for hashtable
Message-Id: <3B4C0796.E1C1FD75@salford.ac.uk>
Benjamin Goldberg wrote:
>
> Torsten Drees wrote:
> >
> > Hi people,
> >
> > i have an interesting problem. i wrote two records in a hash table
> > with the same key. Is it possible to get back, both records.
> > If not, is it possible to define a subkey?
>
> You can, though it's not exactly pretty.
>
> use DB_File;
> $DB_TREE->{flags} |= R_DUP; # allow duplicate keys.
>
> my $d = tie my %hash, "DB_File", undef, O_CREAT|O_RDWR, undef, $DB_TREE;
> # create an in-memory db_file.
Perhaps I'm wrong, but isn't that $DB_BTREE? I'm going off pp 387-392
of Camel 2nd. edition.
^
------------------------------
Date: 11 Jul 2001 10:27:15 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_994847180@rtfm.mit.edu>
Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto <jari.aalto@poboxes.com>
Announcement: "What Emacs lisp modules can help with programming Perl"
Preface
Emacs is your friend if you have to do anything comcerning software
development: It offers plug-in modules, written in Emacs lisp
(elisp) language, that makes all your programmings wishes come
true. Please introduce yourself to Emacs and your programming era
will get a new light.
Where to find Emacs/XEmacs
o Unix:
http://www.gnu.org/software/emacs/emacs.html
http://www.xemacs.org/
o Windows
http://www.gnu.org/software/emacs/windows/ntemacs.html
ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe
o More Emacs resources at
http://tiny-tools.sourceforge.net/emacs-elisp.html
Emacs Perl Modules
Cperl -- Perl programming mode
.ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
.<olson@mcs.anl.gov> Bob Olson (started 1991)
.<ilya@math.ohio-state.edu> Ilya Zakharevich
Major mode for editing perl files. Forget the default
`perl-mode' that comes with Emacs, this is much better. Comes
standard in newest Emacs.
TinyPerl -- Perl related utilities
.http://tiny-tools.sourceforge.net/
If you ever wonder how to deal with Perl POD pages or how to find
documentation from all perl manpages, this package is for you.
Couple of keystrokes and all the documentaion is in your hands.
o Instant function help: See documentation of `shift', `pop'...
o Show Perl manual pages in *pod* buffer
o Load source code into Emacs, like Devel::DProf.pm
o Grep through all Perl manpages (.pod)
o Follow POD manpage references to next pod page with TinyUrl
o Coloured pod pages with `font-lock'
o Separate `tiperl-pod-view-mode' for jumping topics and pages
forward and backward in *pod* buffer.
o TinyUrl is used to jump to URLs (other pod pages, man pages etc)
mentioned in POD pages. (It's a general URL minor mode)
TinyIgrep -- Perl Code browsing and easy grepping
[TinyIgrep is included in the Kit]
To grep from all installed Perl modules, define database to
TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
how to set up datatbases for Perl5, Perl4 whatever you have
installed
TinyIgrep calls Igrep.el to run the find for you, You can adjust
recursive grep options, ignored case, add user grep options.
You can get `igrep.el' module from <kevinr@ihs.com>. Ask for copy.
Check also ftp://ftp.ihs.com/pub/kevinr/
TinyCompile -- Browsing grep results in Emacs *compile* buffer
TinyCompile is minor mode for *compile* buffer from where
you can collapse unwanted lines, shorten the file URLs
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT
-->
cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
file1:NNN: MATCHED TEXT
file1:NNN: MATCHED TEXT
End
------------------------------
Date: Wed, 11 Jul 2001 09:04:00 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: environment variable in cgi
Message-Id: <994842240.473261571023613.gnarinn@hotmail.com>
In article <3913d5b4.0107101800.7ddcb864@posting.google.com>,
hao tran <hao7@yahoo.com> TOP-POSTED AGAIN:
>Hi,
>ok forget about HOME. suppose I have an environment variable that I
>defined set MYNAME = hao7. I display it by echo $MYNAME and get hao7.
>in the script i have: print "$ENV{MYNAME}\n"; I run the script and
>get hao7 printed out. but to call this script from the browser, like
>netscape, the environment variable not displayed. Thanks.
>
>
>gnari <gnarinn@hotmail.com> wrote in message news:<994792339.0208406420424581.gnarinn@hotmail.com>...
>> (
>> please do not top-post.
>> by top-posting, i mean putting your answer at the top of the article,
>> and then quoting the whole of the article you are answering to after that.
>>
>> now i will have to rearrange the article to be able to answer,
>> and usually that puts me off enough so that I do not bother
>> )
>>
(snipped the rest of the (whole) quoted article after top-post)
I give up on you, sorry.
gnari
------------------------------
Date: Wed, 11 Jul 2001 12:17:02 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: Is there an ISO or ANSI certified version of Perl?
Message-Id: <2tX27.22$T3.172652032@news.frii.net>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.
+
Is there an ISO or ANSI certified version of Perl?
Certainly not. Larry expects that he'll be certified before Perl is.
-
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to
news:news.answers
or to the many thousands of other useful Usenet news groups.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-1999 Tom Christiansen and Nathan
Torkington. All rights reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
02.07
--
This space intentionally left blank
------------------------------
Date: 11 Jul 2001 08:44:34 +0100
From: nobull@mail.com
Subject: Re: no pragma in loop
Message-Id: <u9sng398zz.fsf@wcl-l.bham.ac.uk>
Marc Tardif <intmktg@gloria.cam.org> writes:
> Is there a difference in using the no pragma in a loop as opposed to
> setting it outside a loop?
No.
> For instance, consider the following code:
>
> use warnings;
> use strict;
>
> foreach my $var (@vars) {
> my($key, $value) = split(/=/, $pair);
> $value =~ s/foo//;
> ...
> }
>
> In the above, there will be a warning because $value might be undefined.
> So can I set "no warnings qw(uninitialized);" inside the loop so that it
> can be in the tightest scope while not suffering any performance loss from
> having the code being run for every iteration?
Yes. The "no" and "use" are compile-time directives so no extra code
is executed on each iteration.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 11 Jul 2001 05:54:36 -0700
From: vrigas@hotmail.com (Vassilis Rigas)
Subject: Re: Odd scalar equality problem
Message-Id: <70623463.0107110454.7e79f949@posting.google.com>
vrigas@hotmail.com (Vassilis Rigas) wrote in message news:<70623463.0107030553.6b00e5c0@posting.google.com>...
> Ok thats the problem:
>
> I read a file and I have to compare every line with a string posted
> from a html form.
>
> I get the forms value in an index (@value).
> the $value[0] scalar is the name of file I 'd like to check and
> edit...
> the $value[1] scalar is the line I need to match...
>
> That is the code:
>
> open (READFILE,">$value[0]");
> @lines=<READFILE>;
> close READFILE;
>
> open (EDITFILE,">$value[0]");
> foreach $line (@lines){
> if ($line eq $value[1]) #### well it won't match :(
> {
> do stuf...
> }
> print EDITFILE $line ;
> }
> close EDITFILE ;
>
> I wonder if I m doing something wrong.
> When I print the value[1] in the result page, it comes with the write
> value.
>
> If I change the:
> if ($line eq $value[1])
> with
> if ($line eq "a real line")
> everything works fine.
>
> if I put a line like this:
> $value[1]="a real line";
> it also works fine
>
> I m out of ideas... any clue?
>
> TIA
Well finally I solved the problem using CGI.pm (like many of you
suggested). I can not figure why I hade the problem in first place,
but anyway I discovered that CGI.pm can save much time and many
troubles.
Thank you very much guys. Your help is a tresure...
Have a super summer
----- Never look down ------
V.R.
------------------------------
Date: Wed, 11 Jul 2001 13:59:57 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Performance problem--memory bloat or crawl
Message-Id: <4gfokt01j5j1t32dr668fvcipp9q98ht24@4ax.com>
Hi,
On 7/10/2001, "Christopher J. Mackie" <cjmackie@princeton.edu> wrote:
>Apologies for the length of this--I want to be as clear as I can. I'm
>needing to read a large binary file and do a simple manipulation of the
>data.
[...]
How about something like this:
-snip-
#!/usr/bin/perl -w
use strict;
my $rows = 297;
my $cols = 10000; # or whatever
my $chunksize = 100; # how many rows to write
my $datasize = 4; # size of your input type
open( IN, "$datafile" ) or die "Can't open input: $!\n";
open( OUT, ">$outfile" ) or die "Can't open output: $!\n";
binmode( IN );
binmode( OUT );
for( my $i = 0; $i < $cols; $i += $chunksize ){
my @inbuf;
print "read..";
for( my $j = 0; $j < $rows; $j += 1 ){
my $buf;
seek( IN, ($i + $j * $cols )* $datasize, 0 ) or die "!Seek: $!\n";
read( IN, $buf, $chunksize * $datasize );
# adjust unpack below to suit your input data type
@{$inbuf[$j]} = unpack 'L*', $buf;
}
print "write\n";
for( my $i = 0; $i < $chunksize; $i++ ){
for( my $j = $rows -1; $j >= 0; $j-- ){
# adjust unpack below to suit your output data type
print OUT pack 'L', $inbuf[$j]->[$i];
}
}
}
close( OUT );
close( IN );
-snap-
Of course you'd have to adjust the number of columns, the pack/unpack
for reading the data and the data type size. Adjust chunksize to suit
your needs - I didn't try to guess how big the mem size would be.
HTH,
--
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.
------------------------------
Date: 11 Jul 2001 03:37:08 -0700
From: garry_short@hotmail.com (Garry)
Subject: Re: Perl Newbie - problem with NTFS and readdir
Message-Id: <bdcefd33.0107110237.19c2fa32@posting.google.com>
"RobB" <quimby72@my-deja.com> wrote in message news:<20010709.110737.1766342842.30289@berkes.radiology.wisc.edu>...
> Hi,
> very much new to perl, so I imagine I'm doing something wrong, and would
> appreciate any help anyone can provide!
> I am using perl on a dual boot Windows 2000 / Mandrake Linux system.
> Perl version is 5.6.0.
> I am using it from Linux and attempting to read each file/directory in my
> W2K "Documents and Settings/Favorites" folder. The NTFS partition is
> mounted to /mnt/nt, using the "mount -t ntfs" command.
> The problem I run across is that the last file in the directory is never
> opened or processed. I have tried copying the entire directory to my Linux ext2
> filesystem, and that directory IS read in its entirety. I have included
> the effected code I'm using below.
> Since the directory is read fine from an ext2 filesystem, but not an NTFS
> filesystem, it looks like a bug to me, but Im willing to bet it is just
> due to my inexperience with perl. Any help would be greatly appreciated!
> Thanks,
> Rob
>
>
> sub process_directory {
> while ($direntry = readdir (DRCTRY) ) {
> if ($direntry =~ m/url/) {
> print LOG "entry $direntry is a file\n";
> open (URLFILE, "$location/$direntry") || die print LOG "ABORTED. Error opening $direntry";
> while (<URLFILE>) {
> chomp();
> if ( ! /^URL.*/) {next;}
> /(URL=)(.*)/;
> $url = $2;
> $direntry =~ s/\.url//;
> print HTML "Description = <A HREF=$url> $direntry </A><BR>\n";
> }
> close (URLFILE);
> }
> else { print LOG "entry $direntry is NOT a file\n";
> $unread_directories[$number_unread_directories] = "$location/$direntry";
> $number_unread_directories ++;
> }
> }
> }
>
I'm no expert, but I can't see anything wrong with this! What happens
if you try something like :
@dir_list = readdir (DRCTRY);
while (@dir_list) {
$direntry = shift (@dir_list);
If that still does the same thing, I'd expect a bug. Have you tried
running the script from W2k, btw? What does it do then?
I take it LOG and HTML are opened outside this routine?
Also, two things I was a little unsure on ...
1) It assumes that if the filename doesn't include "url", it must be a
folder.
2) It assumes that folder names don't include "url".
You could get around this with "if (-d $direntry) { # if this is a
folder..."
A couple of other things of no importance, but you may be interested
in knowing (not saying you should do these, just offering some
alternatives) ...
1) the "if ( !" could be replaced with an "unless ( "
2) the last two lines could be replaced with
push ( @unread_directories, "$location/$direntry");
Hope this helps,
Regards,
Garry
------------------------------
Date: Wed, 11 Jul 2001 08:23:12 GMT
From: "Joe Bloggs" <joe@bloggs.com>
Subject: Re: Perl will only work by double clicking script it won't work when running it from the command line
Message-Id: <Q1U27.167860$XL1.3220395@nlnews00.chello.com>
Don't want to ask a silly question, but you are putting the name of the
interpreter into the AT command aren't you? ie:
c:\perl\bin\perl.exe your_script_name.pl
------------------------------
Date: Wed, 11 Jul 2001 10:40:58 +0200
From: Philip Newton <pne-news-20010711@newton.digitalspace.net>
Subject: Re: Perl will only work by double clicking script it won't work when running it from the command line
Message-Id: <u64oktoik2doh5p4pc3effv3h81vt8p1gu@4ax.com>
On Wed, 11 Jul 2001 08:23:12 GMT, "Joe Bloggs" <joe@bloggs.com> wrote:
> Don't want to ask a silly question, but you are putting the name of the
> interpreter into the AT command aren't you? ie:
>
> c:\perl\bin\perl.exe your_script_name.pl
Hey Joe,
* please quote enough of the previous message to establish some context
* please followup to the message that needs following-up to. I didn't do
anything with AT, it was ridelightning -- so you should have followed up
to *his* message.
(added after the bounce:)
* please use a valid address when posting, or clearly indicate that it's
not valid, so that private replies can reach you.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: 11 Jul 2001 02:17:33 -0700
From: el@wilmington.net (el)
Subject: Perl/Sendmail not sending mail?
Message-Id: <58929d2c.0107110117.793c7e02@posting.google.com>
Hi all -
I've been banging my head against a wall for two days trying to figure
out what is wrong with my script. I've even stripped it down to the
bare minimum and started building it up again, but am still having
problems.
I'm not getting any errors (note the error sub calls), and everything
"appears" to run ok, but I'm not recieving any email when I test the
script. Can someone please help me figure out what I'm doing wrong?
__________
sub notify {
$mailprog = '/usr/lib/sendmail';
$me = 'el\@foo.com';
open(EMAIL, "|$mailprog $email") || &error("Sendmail error: $!");
print EMAIL "To: $email\n";
print EMAIL "Reply-to: $me\n";
print EMAIL "From: Your Community <$me>\n";
print EMAIL "Subject: LogIn Reminder\n\n";
print EMAIL <<"EMSG";
Please keep this information in a secure place:
Login Identity: $usrid
Password: $passwd
Thank you for helping us build our community.
EMSG
close(EMAIL) || &error("Sendmail error: $!");
}
___________
According to telnet, I can use /usr/lib/sendmail or
/usr/sbin/sendmail. I have tested open(EMAIL ... using "-t," "-oi,"
"-t -oi," and "$email". I tested it using "return close(EMAIL);"
since I am calling sendmail from a subroutine. And I tested it using
an "or die" statement instead of calling my error sub. My permissions
are set at 0755 (I even tested the script using 0777) in a directory
with 0777 permissions.
As I said, everything looks like it works: no error's returned, etc.,
it just doesn't actually send the e-mail. Can anyone "see" what I am
doing wrong?
TIA, el
------------------------------
Date: 11 Jul 2001 11:57:41 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Perl/Sendmail not sending mail?
Message-Id: <slrn9kofq3.av5.rgarciasuarez@rafael.kazibao.net>
el wrote in comp.lang.perl.misc:
}
} I'm not getting any errors (note the error sub calls), and everything
} "appears" to run ok, but I'm not recieving any email when I test the
} script. Can someone please help me figure out what I'm doing wrong?
}
} __________
} sub notify {
} $mailprog = '/usr/lib/sendmail';
} $me = 'el\@foo.com';
You're not using "strict" ? and -w ? You should. This can point you
basic errors that are otherwise a pain to detect.
} open(EMAIL, "|$mailprog $email") || &error("Sendmail error: $!");
I hope that you're sure that's $email here.
} print EMAIL "To: $email\n";
} print EMAIL "Reply-to: $me\n";
} print EMAIL "From: Your Community <$me>\n";
} print EMAIL "Subject: LogIn Reminder\n\n";
} print EMAIL <<"EMSG";
} Please keep this information in a secure place:
} Login Identity: $usrid
} Password: $passwd
}
} Thank you for helping us build our community.
} EMSG
} close(EMAIL) || &error("Sendmail error: $!");
} }
} ___________
}
} According to telnet, I can use /usr/lib/sendmail or
} /usr/sbin/sendmail.
Probably one of them is a symlink to the other.
} I have tested open(EMAIL ... using "-t," "-oi,"
} "-t -oi," and "$email". I tested it using "return close(EMAIL);"
} since I am calling sendmail from a subroutine. And I tested it using
} an "or die" statement instead of calling my error sub.
Have you read perldoc -q "send mail" ?
Have you checked the mail queue and the maillogs ? The problem may come
from the sendmail configuration at the host you're using. Is it the
recommended configuration ?
Have you tried to use a Mail module and to connect to a SMTP server,
other than your host ?
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: 11 Jul 2001 03:22:07 -0700
From: over13@orc.ru (Aleksey)
Subject: Problem with install packade (parser.pm error)
Message-Id: <8e03119b.0107110222.698a75ee@posting.google.com>
Hi!
I try to install DBI and MySQL lib for active PERL. But I get next
error when I input command after run ppm.bat :
not well-formed at line 1, column 17, byte 17 at
C:/Perl/site/lib/SOAP/Parser.pm
line 73
Who can decide this problem respond me as soon as possiable copy on
mail over13@orc.ru
By!
------------------------------
Date: Wed, 11 Jul 2001 09:14:24 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: problems with Apache and DBI (Oracle)
Message-Id: <994842864.599085272289813.gnarinn@hotmail.com>
In article <GG9vuC.15D5@alfalfa.utcs.utoronto.ca>,
Daniel Czajko <czajko@ocas.on.ca> wrote:
>I'm trying to run some Perl scripts that connect to an Oracle Database and
>output the information onto an HTML page running on Apache. I can fetch the
>information from the database via DBI and display it at command line, but I
>don't seem to be able direct the output onto an HTML page. Does anybody
>know of any issues between Apache and DBI (Oracle)? I wish I could provide
>some output errors but there are none, the html page just won't appear.
>
>Any help is appreciated
>
Not much info here.
YHave you looked at Apaches error log?
have you looked at ways to get errors into HTML output?
perldoc CGI::Carp
(I dont remember if CGI::Carp is standard. if not, look at www.cpan.org
Anyways, the usual things are current directory and environment.
If non-DBI cgi scripts work, them my guess is environment
Databases often need some %ENV variables set.
gnari
------------------------------
Date: 11 Jul 2001 08:17:43 +0100
From: nobull@mail.com
Subject: Re: regular expression ???
Message-Id: <u9u20j995j.fsf@wcl-l.bham.ac.uk>
"Eric Chow" <eric138@yahoo.com> writes:
> Would you please to teach me how I can compare two string to test if they
> are equals or not by using regular expression ?
print "are equal" if $str1 =~ /\A\Q$str2\E\z/;
What next? How to drive nails with a wrench?
print "are equal" if $str1 eq $str2;
> The two string may not be considered their space or capital letter at every
> separated word.
I'm not sure I understood that but I think you meant you want a case
insensative comparison and to consider any amount of whitespace to be
equivalent.
( my $str1copy = lc $str1 ) =~ s/\s+/ /g;
( my $str2copy = lc $str2 ) =~ s/\s+/ /g;
print "are equal" if $str1copy eq $str2copy;
OR if, as I suspect, you have one value of $str2 and want to test a
lot of different $str1...
my $pattern = join '\s+' => map {quotemeta} split /\s+/ => $str2;
$pattern = qr/\A$pattern\z/i;
print "are equal" if $str1 =~ /$pattern/;
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 11 Jul 2001 11:18:11 GMT
From: Laszlo Gerencser <laszlo.gerencser@portologic.com>
Subject: Re: Some perl questions
Message-Id: <3B4C362E.FA20CF63@portologic.com>
gnari wrote:
> actually it says (in my version):
>
> shift ARRAY
> shift
>
> meaning it can be called with or without array parameter
Agree. I didn't mention that it's illegal. I just tried to explain the
situation to a newbie with my humble words.
> dont forget that the default can be @ARGV
Yes, can be, but the original post suggested that it's in a sub scope so
we can
assume it IMHO.
> >But don't get started learning perl from perldoc. That's for reference.
> >Get a good perl book.
> Yes a good book is great, but spending a weekend reading all the
> perldocs can also be a good way, if Perl is not your first programming
> language.
Well, I suggest newbies to start with a book anyway...
I'm not a teenager, Perl was not the first, nor the fifth language I
learned...
But the necessity of reading the doc and all the faqs is unquestionable.
And spending a week (not only a weekend) on it playing with test cases
is the best that a programmer can do.
And - last, but not least - it's fun! :-))
> It is also great to read the faq once in a while. Then later when you
> have a problem, chances are that you will remember reading something
> about something similar there, and it will be easier to look it up.
Agree.
> gnari
Lacus
--
Laszlo Gerencser
PortoLogic Ltd.
------------------------------
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 1283
***************************************