[15632] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3045 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 15 00:05:47 2000

Date: Sun, 14 May 2000 21:05:08 -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: <958363508-v9-i3045@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 14 May 2000     Volume: 9 Number: 3045

Today's topics:
    Re: Access from several Perl-Scripts on one variable? <madmardy@madmardy.com>
    Re: Defining charset in cgi script <phill@modulus.com.au>
    Re: Defining charset in cgi script <webmaster@linkworm.com>
    Re: Defining charset in cgi script <trexxa@gireve.com>
    Re: file confusing <madmardy@madmardy.com>
        File lock? Help Needed!! <k2_1999@hotmail.com>
    Re: File lock? Help Needed!! <phill@modulus.com.au>
    Re: File lock? Help Needed!! <madmardy@madmardy.com>
    Re: files <makarand_kulkarni@My-Deja.com>
    Re: Help Needed  - Perl Matching Operator <jc@juliancardarelli.com>
        Help! Can't find Perl work! <kj0@mailcity.com>
    Re: Help! Can't find Perl work! <madmardy@madmardy.com>
    Re: How to COPY a website <makarand_kulkarni@My-Deja.com>
    Re: How to COPY a website <madmardy@madmardy.com>
    Re: How to COPY a website greg@apple2.com
    Re: How to COPY a website <thor@anta.net>
        perl script to manage sendmail? <schan_ca@geocities.com>
    Re: perl script to manage sendmail? <tomp@sci.fi>
    Re: perl script to manage sendmail? <madmardy@madmardy.com>
    Re: perl script to manage sendmail? <tony_curtis32@yahoo.com>
    Re: perl script to manage sendmail? <tony_curtis32@yahoo.com>
    Re: Problem with server scripting <dennis_marti@yahoo.com>
    Re: pure Perl Webserver with CGI & Win32::ODBC - I'm se <phill@modulus.com.au>
    Re: Specify a path in the use <madmardy@madmardy.com>
    Re: two hashes to one (Craig Berry)
    Re: Why does Perl do this? (Tramm Hudson)
        XBase and Order by .. HELP krpotter@co.douglas.or.us
    Re: XBase and Order by .. HELP <jeff@vpservices.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 14 May 2000 21:32:25 -0600
From: Mark Holt <madmardy@madmardy.com>
Subject: Re: Access from several Perl-Scripts on one variable?
Message-Id: <391F6FC9.43E3657E@madmardy.com>

This is an advanced topic, you must use the experimental thread module, or
the shmget (see perldoc -f shmget) command.  What is it that you are trying
to do, and maybe we can help you figure out a better way?

Thorsten wrote:

> Is it possible to access from several Perl-Scripts on one variable?
>
> I would be really glad if you could answer me that question and how to do
> so, because this would mean to me to save several hours of work.
>
> Thank you very much!



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

Date: Mon, 15 May 2000 11:31:30 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Defining charset in cgi script
Message-Id: <391F5372.DEB@modulus.com.au>

Jimmy E. wrote:
> 
> Hello,
> 
> I would like to know how can I define a charset in a .cgi script file.
> 
> My regular html pages contain the following line in order to use the Greek
> Character set:
> 
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1253">
> 
> How do I translate this line in order to be inserted in a .cgi scept file.
> If I'll insert it as-is, I get an error.
> 
> I use some Greek text as output on my cgi, and 1253 charset must be used in
> order for the characters to be displayed properly.
> 
> Thanks in advance.

print "Content-type: text/html; charset=windows-1253\n\n";

Should do the trick.
-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Sun, 14 May 2000 19:50:51 -0700
From: "LinkWorm Software, Inc." <webmaster@linkworm.com>
Subject: Re: Defining charset in cgi script
Message-Id: <391F660B.B85272FE@linkworm.com>

"Jimmy E." wrote:
> 
> Hello,
> 
> I would like to know how can I define a charset in a .cgi script file.
> 
> My regular html pages contain the following line in order to use the Greek
> Character set:
> 
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1253">
> 
> How do I translate this line in order to be inserted in a .cgi scept file.
> If I'll insert it as-is, I get an error.
> 
> I use some Greek text as output on my cgi, and 1253 charset must be used in
> order for the characters to be displayed properly.
> 
> Thanks in advance.

print q!<meta http-equiv="Content-Type" content="text/html;
charset=windows-1253">!;

Or a HERE DOC:

print <<_SOMETHING_;
Other HTML here...
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1253">
Other HTML...
_SOMETHING_

 ... I was going to ask what language your CGI script was in, but I
noticed this post was sent to coomp.lang.perl.misc, so I'm assuming it's
in Perl now... This is simply a syntax problem... One of the most very
basic one's you can have, so I strongly suggest you read _something_
(almost _anything_ you can find!) about Perl, or chance annoying people.
-- 
Regards,
Tim Greer: tech@linkworm.com | LinkWorm Software http://www.linkworm.com
Tel: 530 247-1749. Programming, CGI, Perl, C/C++, ASP, SQL, more. Design
Web Server & Network Administration, Security, Consulting, Installations
Configuration. Unix/Linux/FreeBSD & NT. Apache, IIS, TCP/IP, LAN/WAN/WWW


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

Date: Mon, 15 May 2000 02:45:59 GMT
From: "Jimmy E." <trexxa@gireve.com>
Subject: Re: Defining charset in cgi script
Message-Id: <HxJT4.65978$so1.764661@news20.bellglobal.com>

Thanks!
Do I put this line only once in the begining of the script file, or every
time before text?

> print "Content-type: text/html; charset=windows-1253\n\n";
>
> Should do the trick.




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

Date: Sun, 14 May 2000 21:29:25 -0600
From: Mark Holt <madmardy@madmardy.com>
Subject: Re: file confusing
Message-Id: <391F6F15.5966BCAD@madmardy.com>

yours is soooo slow.  Try this:opendir DH, "$curdir/$namev"  or die
"Can't open: $!";my @entries = readdir DH;
closedir DH;
foreach my $entry
(map "$curdir/$namev/$_", @entries) { # MUST prepend directory!
  lstat $entry;  #stat only ONCE
  my $time = scalar localtime(-M _) # '_' is the last file stat'ed
  my $size = -s _;
  print "\n$entry $time $size";
}

Daniel van den Oord wrote:

> Doing this causes only the parent directory and directory above to get
> a right time and size index wh wh whyyy ???#!c:\perl\bin $namev =
> "Inetpub";
> $curdir = "c:/"; opendir DH, "$curdir/$namev"  or die "Can't open:
> $!"; while ($namev = readdir(DH)) {
> $time1 = (stat($namev))[9];
> $time2 =  scalar localtime($time1);
> $size = (stat($namev))[7];
> print "\n$namev $time2 $size";
> }
> closedir(DH);Daniel van den Oord      ( Daniel304 RTCL )
> -----------------------------------------------------------------------
> It's nice to be important, but it's more important to be nice
> See there be good bye bye
> -----------------------------------------------------------------------
> Daniel304rt ResearchTriangle Community Leader
> http://www.geocities.com/ResearchTriangle/Forum/5577



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

Date: Mon, 15 May 2000 01:37:45 GMT
From: "Kelvin" <k2_1999@hotmail.com>
Subject: File lock? Help Needed!!
Message-Id: <JxIT4.10672$%u6.605181@news1.telusplanet.net>

Hi, I've wrote a couple cgi-perl script and they have to store and read data
from a txt file!
They like the vote or counter, they will add some count or vote to the file!
The script run fine, but the main problem is the the data file will "reset"
sometimes!!
I mean, let say I've 500 counts on Monday, but on Tuesday the file only have
10 counts!!

I thought that was the problem of the flock!
I've already put it in, but little confuse, can any help to solve?
Thanks in advance!

Here is the code about read and write :

open (WriteResult, ">vote.dat");
    flock (InBook, 2);
    seek (InBook, 0, 2);
    foreach $key (keys (%GCount)){
        print WriteResult
"$key|$GVote{$key}|$GCount{$key}|$GAverage{$key}\n";
    }
close (WriteResult);




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

Date: Mon, 15 May 2000 12:14:16 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: File lock? Help Needed!!
Message-Id: <391F5D78.511B@modulus.com.au>

Kelvin wrote:
> 
> Hi, I've wrote a couple cgi-perl script and they have to store and read data
> from a txt file!
> They like the vote or counter, they will add some count or vote to the file!
> The script run fine, but the main problem is the the data file will "reset"
> sometimes!!
> I mean, let say I've 500 counts on Monday, but on Tuesday the file only have
> 10 counts!!
> 
> I thought that was the problem of the flock!
> I've already put it in, but little confuse, can any help to solve?
> Thanks in advance!
> 
> Here is the code about read and write :
> 
> open (WriteResult, ">vote.dat");
>     flock (InBook, 2);
>     seek (InBook, 0, 2);
>     foreach $key (keys (%GCount)){
>         print WriteResult
> "$key|$GVote{$key}|$GCount{$key}|$GAverage{$key}\n";
>     }
> close (WriteResult);

See perlfaq5 "I still don't get locking. I just want to increment the
number in the file."

-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Sun, 14 May 2000 21:16:23 -0600
From: Mark Holt <madmardy@madmardy.com>
Subject: Re: File lock? Help Needed!!
Message-Id: <391F6C07.D9E29868@madmardy.com>

Looks like you are locking the file you are reading from and not the file you
are writing to!  This is a deadly error.  Try locking both with a LOCK_EX before
you read OR write.  It is slower but the only way to avoid a race condition.
The best approach with textfiles is to read/write to the same file, and get only
one lock.

Kelvin wrote:

> Hi, I've wrote a couple cgi-perl script and they have to store and read data
> from a txt file!
> They like the vote or counter, they will add some count or vote to the file!
> The script run fine, but the main problem is the the data file will "reset"
> sometimes!!
> I mean, let say I've 500 counts on Monday, but on Tuesday the file only have
> 10 counts!!
>
> I thought that was the problem of the flock!
> I've already put it in, but little confuse, can any help to solve?
> Thanks in advance!
>
> Here is the code about read and write :
>
> open (WriteResult, ">vote.dat");
>     flock (InBook, 2);
>     seek (InBook, 0, 2);
>     foreach $key (keys (%GCount)){
>         print WriteResult
> "$key|$GVote{$key}|$GCount{$key}|$GAverage{$key}\n";
>     }
> close (WriteResult);



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

Date: Sun, 14 May 2000 19:06:58 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: files
Message-Id: <391F5BC2.A8DA43EC@My-Deja.com>



Daniel van den Oord wrote:

> Is there some easy way of getting filesize / filetype and those things
> ???

perldoc perlfunc
Look under "functions for filehandles"
eg
                 -f  File is a plain file.
                 -d  File is a directory.
                 -l  File is a symbolic link.
                 -p  File is a named pipe (FIFO), or Filehandle is a
pipe.
                 -S  File is a socket.
                 -b  File is a block special file.
                 -c  File is a character special file.
                 -t  Filehandle is opened to a tty.




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

Date: Mon, 15 May 2000 01:51:28 GMT
From: "Julian L. Cardarelli" <jc@juliancardarelli.com>
Subject: Re: Help Needed  - Perl Matching Operator
Message-Id: <AKIT4.5757$f12.133873@news1.rdc1.on.wave.home.com>

tr/@//d is 200% faster (2 wallclocks)

= Julian

Andrew N. McGuire wrote in message <3918EBDD.C898CDB1@ce.mediaone.net>...
>Shell Hung wrote:
>>
>> There're no different of m/// and s///, for example, if you want remove
>> all "@" inside the email address, you can use s/// | m///,
>> $Email = "abc\@abc.com";
>> $Email =~ s/\@//;
>> Now, $Email = "abcabc.com";
>
>[ snip of jeopardized post ]
>
>There is a difference, did you even try doing 'm/\@//'
>instead of 's/\@//'? The former generates a syntax error
>while the latter preforms the desired substitution.
>Also 's/\@//' will not remove all '@' charachters, only
>the first in the string.  You need to add the 'g' modifier
>at the end to make it do what you said.  Also I believe it
>is faster to do 'tr/@//d', although I have never personally
>benchmarked it.
>
>Cheers,
>
>anm




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

Date: 14 May 2000 21:33:39 -0400
From: kj0 <kj0@mailcity.com>
Subject: Help! Can't find Perl work!
Message-Id: <8fnk5j$k3p$1@panix3.panix.com>



Hi!  I'm a grad student working a PhD in bioinformatics; I live in
Boston, MA.  I have 6 years of Perl programming experience, mostly
doing bioinformatics and system's management applications. (FWIW, I'm
knowledgeable enough to be the "local Perl guru" in a group of about
20 grad students and postdocs).

For several months now I've been trying to find part-time work
programming in Perl in the Boston/Cambridge area, with absolutely no
success (not even close).

This is surprising to me.  Maybe I'm not looking in the right places.
Is there a clearing house for job openings for Perl programmers in the
New England area?  Any other resources (free or not) for Perl job
hunters (resume critiquing, head hunters, etc.) I should know about?

Thanks for any suggestions,

Kev




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

Date: Sun, 14 May 2000 21:14:19 -0600
From: Mark Holt <madmardy@madmardy.com>
Subject: Re: Help! Can't find Perl work!
Message-Id: <391F6B8B.E86AE9B1@madmardy.com>

This is very surprising to me.  I have about 3 yrs of exp. and cannot beat
all of the offers off with a stick! :)  Did you try dice.com?  Maybe
you'll have to move out west (I'm in Utah:)

kj0 wrote:

> Hi!  I'm a grad student working a PhD in bioinformatics; I live in
> Boston, MA.  I have 6 years of Perl programming experience, mostly
> doing bioinformatics and system's management applications. (FWIW, I'm
> knowledgeable enough to be the "local Perl guru" in a group of about
> 20 grad students and postdocs).
>
> For several months now I've been trying to find part-time work
> programming in Perl in the Boston/Cambridge area, with absolutely no
> success (not even close).
>
> This is surprising to me.  Maybe I'm not looking in the right places.
> Is there a clearing house for job openings for Perl programmers in the
> New England area?  Any other resources (free or not) for Perl job
> hunters (resume critiquing, head hunters, etc.) I should know about?
>
> Thanks for any suggestions,
>
> Kev



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

Date: Sun, 14 May 2000 19:12:55 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: How to COPY a website
Message-Id: <391F5D27.BBB14B32@My-Deja.com>


> Are there any good scripts out there for retrieving all the files found at a
> website?  Essentially, I would like to point this tool at a URL and have it
> decend all the local links and retrieve all the content associated with
> static html links.

use lynx  ( text base browser)

investigate the options

-crawl
-traversal
-dump

good luck/





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

Date: Sun, 14 May 2000 21:20:51 -0600
From: Mark Holt <madmardy@madmardy.com>
Subject: Re: How to COPY a website
Message-Id: <391F6D13.7C8073DF@madmardy.com>

I was writing a script for this.  But teleport pro is useless because it only runs
on windows.  I need something I can plug into a CGI to copy a website to my server
upon an HTTP request.  If anyone knows of anything on UNIX, I'd like to see it.

FYI lynx -traversal -crawl outputs a list of all valid URL's to a file
(traverse2.dat on my system).  This saves the trouble of parsing the pages
yourself (a difficult chore).  The problem is, I want to limit the depth, and this
does not help.  So anyone who has something out there is encouraged to let the
rest of us know.

Tony Reed wrote:

> In article <CkFT4.5349$f12.123160@news1.rdc1.on.wave.home.com>, "Keith
> Smith" <ksmith@firesnacks.com> wrote:
>
> : Hi folks:
> :
> : Are there any good scripts out there for retrieving all the files found at a
> : website?  Essentially, I would like to point this tool at a URL and have it
> : decend all the local links and retrieve all the content associated with
> : static html links.
>
> Although this isn't the place, and although I don't use IE, I should
> say that Internet Explorer has this kind of thing built into it.  When
> you do a "save as" it will let you save the whole site as a compressed
> archive, and you can specify how may layers down you want to go, and if
> you want to save "off-site" links.  I thought at the time, "geez, I
> wish Netscape did this."
> --
> Tony Reed <mailto:callus@sympatico.ca>
> Open the door softly, somebody wants you dear!  You'll hear him calling you,
> bump, like a blizz in the muezzin of the turkest night.



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

Date: Sun, 14 May 2000 22:46:12 -0500
From: greg@apple2.com
Subject: Re: How to COPY a website
Message-Id: <greg-A692DD.22461214052000@news.binary.net>

In article <CkFT4.5349$f12.123160@news1.rdc1.on.wave.home.com>,
"Keith Smith" <ksmith@firesnacks.com> wrote:

> Are there any good scripts out there for retrieving all the files 
> found at a website?  Essentially, I would like to point this tool at 
> a URL and have it decend all the local links and retrieve all the 
> content associated with static html links.

Most FTP clients have this capability, assuming you have access to the 
web server via FTP.  As to taking a copy of the whole site via HTTP en 
mass, as evidenced by some webmasters' postings seeking to prevent just 
this sort of activity, perhaps you should ask first.  Perhaps they'll 
provide you with a nice, zipped copy.

-- 
__  _____________  __
\ \_\ \__   __/ /_/ /                 <greg@apple2.com>                   ___
 \  __ \ | | / __  /----------------------------------------------------\-\|/-/
  \_\ \_\|_|/_/ /_/          <http://www.war-of-the-worlds.org/>


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

Date: Mon, 15 May 2000 06:30:18 +0300
From: Thor Kottelin <thor@anta.net>
Subject: Re: How to COPY a website
Message-Id: <391F6F4A.AA37577C@anta.net>



Keith Smith wrote:

> Are there any good scripts out there for retrieving all the files found at a
> website?  Essentially, I would like to point this tool at a URL and have it
> decend all the local links and retrieve all the content associated with
> static html links.

wget is a good spider.

Thor

-- 
Plain old email is very insecure. Please make it
a little safer for yourself and me by using PGP.
FAQ: <URL:http://www.pgp.net/pgpnet/pgp-faq/>.
My public keys are available from key servers.




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

Date: Mon, 15 May 2000 02:04:18 GMT
From: steve <schan_ca@geocities.com>
Subject: perl script to manage sendmail?
Message-Id: <391F5CE2.2EA21E07@geocities.com>

Hello:

Any idea on how to manage sendmail via a perl script?
I need to manage email accounts, aliases and redirect email.
Are there Perl modules for this? If not what steps do I need
to know to code this myself?

Thanks
Steve






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

Date: Mon, 15 May 2000 05:30:04 +0300
From: zc <tomp@sci.fi>
Subject: Re: perl script to manage sendmail?
Message-Id: <391F612C.E57AF48C@sci.fi>

$prog= '/usr/lib/sendmail';
open (mail, "|$prog -t") or die "Can't pipe sendmail";
print mail "To: <blah>\n";
print mail "Reply-to: <blah>\n";
print mail "Subject: <blah>\n";
close(mail);

maybe that will help you.


steve wrote:

> Hello:
>
> Any idea on how to manage sendmail via a perl script?
> I need to manage email accounts, aliases and redirect email.
> Are there Perl modules for this? If not what steps do I need
> to know to code this myself?
>
> Thanks
> Steve



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

Date: Sun, 14 May 2000 21:09:02 -0600
From: Mark Holt <madmardy@madmardy.com>
Subject: Re: perl script to manage sendmail?
Message-Id: <391F6A4E.DE133E71@madmardy.com>

You cannot create accounts directly with perl, mail accounts are
determined by your pop daemon, which usually gives one account to each
unix user.  So you must use useradd, userdel, and usermod to manage mail
accounts.  This means your script must run as root.  An alternative is
to set up a virtual pop daemon, and manage your own virtual password
file.  This has its security problems.
To set up aliases, you must edit /etc/aliases and then run newaliases.

Finally, if you want to parse every message, you can setup the alias in
/etc/aliases:
redirect:    "|/home/me/perlredirect.pl"

This will invoke your perl script with the message on STDIN every time
it is received, then you can use sendmail to redirect it where it needs
to go.  I must say though, that this would not be very efficient...

steve wrote:

> Hello:
>
> Any idea on how to manage sendmail via a perl script?
> I need to manage email accounts, aliases and redirect email.
> Are there Perl modules for this? If not what steps do I need
> to know to code this myself?
>
> Thanks
> Steve



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

Date: Mon, 15 May 2000 03:15:51 GMT
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: perl script to manage sendmail?
Message-Id: <8766sgh5aw.fsf@shleppie.uh.edu>


[ posted jeopardy style, rearranged for legibility ]

>> On Mon, 15 May 2000 05:30:04 +0300,
>> zc <tomp@sci.fi> said:

> steve wrote:

>> Hello:
>> 
>> Any idea on how to manage sendmail via a perl script?
>> I need to manage email accounts, aliases and redirect
>> email.  Are there Perl modules for this? If not what
>> steps do I need to know to code this myself?
>> 
>> Thanks Steve

> $prog= '/usr/lib/sendmail'; open (mail, "|$prog -t") or
> die "Can't pipe sendmail"; print mail "To: <blah>\n";
> print mail "Reply-to: <blah>\n"; print mail "Subject:
> <blah>\n"; close(mail);

Better to use UPPERCASE for file-handles.

This doesn't address what the OP was asking.  The original
request was for admin tools for sendmail configurations,
not how to use send a message using perl.

If there are any modules for this in general circulation,
one will be able to find them @

    http://search.cpan.org/

or poke around with a search engine.

    http://www.sendmail.com/

would be a prebuilt solution (yes, that's .com not .org).
Also take a look at

    http://www.stokely.com/unix.sysadm.resources/email.html

for more ideas.

Of course, this could be a chance to make a name for
oneself! :-)

hth
t


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

Date: Mon, 15 May 2000 03:38:15 GMT
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: perl script to manage sendmail?
Message-Id: <873dnkh49k.fsf@shleppie.uh.edu>


[ posted jeopardy style, rearranged for legibility ]

>> On Sun, 14 May 2000 21:09:02 -0600,
>> Mark Holt <madmardy@madmardy.com> said:

> steve wrote:

>> Hello:
>> 
>> Any idea on how to manage sendmail via a perl script?
>> I need to manage email accounts, aliases and redirect
>> email.  Are there Perl modules for this? If not what
>> steps do I need to know to code this myself?
>> 
>> Thanks Steve

> You cannot create accounts directly with perl, mail
> accounts are determined by your pop daemon, which

Hmm...nobody mentioned POP at all.  Mail accounts are not
necessarily related to POP, and even if a system has both
POP and sendmail running, the connection is probably
tangential.

> usually gives one account to each unix user.  So you
> must use useradd, userdel, and usermod to manage mail
> accounts.  This means your script must run as root.  An
> alternative is to set up a virtual pop daemon, and
> manage your own virtual password file.  This has its
> security problems.  To set up aliases, you must edit
> /etc/aliases and then run newaliases.

Also, different systems have different admin tool names,
you won't have useradd etc. on each platform.

/etc/aliases may also not be the location of the aliases
(e.g. could be /etc/mail/aliases).

hth
t


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

Date: Sun, 14 May 2000 21:17:22 -0400
From: Dennis Marti <dennis_marti@yahoo.com>
Subject: Re: Problem with server scripting
Message-Id: <dennis_marti-A46A86.21172214052000@news.starpower.net>

In article <8fkehe$2kv$1@plutonium.btinternet.com>, "Andy Chantrill" 
<andy@u2me3.com> wrote:

> You can't read from and write to the same file handle (<f>).

yes you can.

from perlfunc:

You can put a '+' in front of the '>' or '<' to indicate that you want 
both read and write access to the file; thus '+<' is almost always 
preferred for read/write updates--the '+>' mode would clobber the file 
first.

Dennis


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

Date: Mon, 15 May 2000 11:54:52 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: pure Perl Webserver with CGI & Win32::ODBC - I'm searching
Message-Id: <391F58EC.49AE@modulus.com.au>

Salvo Jr wrote:
> 
> can anyone help me to find a pure Perl Webserver with CGI & Win32::ODBC
> support (under Win9x)?
> I tried "MacPerl" webserver and "HTTPD" webserver but Win32::ODBC don't work
> Thank You
> Salvo Jr
> salvojr@rocketmail.com
Salvo,
I'm guessing here but it sounds like you are trying to excute code which
uses Win32::ODBC on a Macintosh, yes? That is not going to work just by
replacing the http server.

Either:
1) You find a Mac-capable replacement for the module Win32::ODBC (search
at CAPN) or
2) You run Win32 emulation on your Mac in case you can't find this
replacement - your results may still be unpredictable
hth
-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Sun, 14 May 2000 21:03:31 -0600
From: Mark Holt <madmardy@madmardy.com>
Subject: Re: Specify a path in the use
Message-Id: <391F6903.682A6297@madmardy.com>

If you use double quotes, you must use double backslashes.

"Cyril H." wrote:

> Hello, I have a simple quetion :
>
> I'm using perl on Windows , and I'd like to use a specified file in my
> script. The problem is I don't know how to include the path of my file.
>
> The following  ...
>
> use CGI;
> use "c:\mylib\uilts.pm";
>
> doesn't work.
>
> Any idea?
>
> Thanks a lot.
>
> \Cyril.



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

Date: Mon, 15 May 2000 01:49:42 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: two hashes to one
Message-Id: <shultmrfje445@corp.supernews.com>

Jan Willem Boer (jwboer@NOSPAM.chriscom.nl) wrote:
: I try to make one hash out of 2. This code doesn't seem to work:
: 
:     $numberOfRecords = push(%database, %addRecordInfo);
: 
: How should i do this?

First, you need to decide what to do with duplicate keys.  In the simple
case of overlaying values from %addRecordInfo onto any matching keys in
%database, this works:

  @database{keys %addRecordInfo} = values %addRecordInfo;

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "The road of Excess leads to the Palace
      of Wisdom" - William Blake


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

Date: 15 May 2000 02:20:14 GMT
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: Why does Perl do this?
Message-Id: <8fnmsu$b5b$1@sloth.swcp.com>
Keywords: troll troll troll

[posted and cc'd to cited author]

Abigail <abigail@arena-i.com> wrote other stuff, but this is all
that I left in place to misquote the previous discussion:
%^& ... There are infinitely many
%^& programming mistakes one can make, using no more than 50 characters.

However, since we have a finite number of characters in our language
(roughly 256, if we assume character == octect) the maximum
number of strings in this language is:

	2^(50*8)

which is a finite, bounded number.  Even assuming that each of
those strings may have a large (finite) number of erroroneous
interpretations, that still leaves us (within a constant) at
the same order of magnitude for possible errors within a
finite number of characters.

Or do you have a different interpretation that I am missing?

Tramm
-- 
  o   hudson@swcp.com                 tbhudso@cs.sandia.gov   O___|   
 /|\  http://www.swcp.com/~hudson/          H 505.323.38.81   /\  \_  
 <<   KC5RNF @ N5YYF.NM.AMPR.ORG            W 505.284.24.32   \ \/\_\  
  0                                                            U \_  | 


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

Date: Mon, 15 May 2000 02:14:45 GMT
From: krpotter@co.douglas.or.us
Subject: XBase and Order by .. HELP
Message-Id: <8fnmic$q9j$1@nnrp1.deja.com>

Has anyone had any problems using XBase against a foxpro database file,
and the ORDER BY clause specifing multiple fields.  I'm trying (notice
the ORDER BY clause):

#######################
use XBase;
use DBI;

$query = "select DATABASE_L,NOTATION,LINK from feimage where NOTATION
like '%91210' order by DATABASE_L, LINK";

my $dbh = DBI->connect("DBI:XBase:I:/fe/datfile");
my $sth = $dbh->prepare($query);
$sth->execute();
#########################

And receive the following error:

DBD::XBase::db prepare failed: Extra characters in SQL command near ',
LINK' at C:\test\test.pl line 17.

If I specify either DATABASE_L, or LINK by themselves, everything runs
fine, but both together fail with the above error.

Any help would be much appreciated (and email to me would be terrific)

Kevin
krpotter@co.douglas.or.us.BLAH
(remove the trailing .BLAH)


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


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

Date: Sun, 14 May 2000 19:25:36 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: XBase and Order by .. HELP
Message-Id: <391F6020.D8263661@vpservices.com>

krpotter@co.douglas.or.us wrote:
> 
> Has anyone had any problems using XBase against a foxpro database file,
> and the ORDER BY clause specifing multiple fields.  I'm trying (notice
> the ORDER BY clause):

From the DBD::Xbase documentation:

The select command may contain an order by clause. Only one column is
supported for sorting at the moment, patches are welcome.

-- 
Jeff


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 3045
**************************************


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