[12534] in Perl-Users-Digest
Perl-Users Digest, Issue: 6134 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 26 08:07:16 1999
Date: Sat, 26 Jun 99 05:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 26 Jun 1999 Volume: 8 Number: 6134
Today's topics:
Re: "Slurping" a .jpg file <swiftkid@bigfoot.com>
Re: ACL access <gellyfish@gellyfish.com>
Re: Active State perl and Personal Oracle 8 <gellyfish@gellyfish.com>
Re: Can not write my file to the server <gellyfish@gellyfish.com>
Re: Creating graphics on the fly for web pages <gellyfish@gellyfish.com>
Re: Determining limit on size of data that a Perl CGI p <gellyfish@gellyfish.com>
Re: Determining limit on size of data that a Perl CGI p <swiftkid@bigfoot.com>
Re: Dynamic Page Generation <gellyfish@gellyfish.com>
Re: Error in my CGI that a can't find! Need help debug <gellyfish@gellyfish.com>
Re: format the output of scalar date/time <gellyfish@gellyfish.com>
I need help with pack! esalmon@packet.net
Re: installing Tk.pm <gellyfish@gellyfish.com>
Re: Is dbi multi threaded? <gellyfish@gellyfish.com>
Re: large files (>2G), perl, solaris 2.6 x86 <swiftkid@bigfoot.com>
Re: localtime (perldoc -f localtime didn't help) <gellyfish@gellyfish.com>
Re: Need some help on Sockets BSDI 4.0 <gellyfish@gellyfish.com>
Re: Net::SMTP - Adding a subject <gellyfish@gellyfish.com>
Re: perl script for URLs? <gellyfish@gellyfish.com>
Re: rename dose not work <gellyfish@gellyfish.com>
Re: Server Running Perl - Resources? <webmaster@chatbase.com>
Re: should be how to remove ^M from middle of variable? (Bart Lateur)
Re: syntax check without execution <gellyfish@gellyfish.com>
Re: The Perlfaq Man Can! (was: problems with chmod func (Bart Lateur)
Re: trapping "severe warnings"? <gellyfish@gellyfish.com>
Re: Using Perl with an ADVFS filesystem... <gellyfish@gellyfish.com>
Win32::OLE help needed <mike@crusaders.no>
Re: WWWBoard for NT <gellyfish@gellyfish.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 26 Jun 1999 14:48:22 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: "Slurping" a .jpg file
Message-Id: <7l3atb$9m2@news.cyber.net.pk>
open FILE , "blah.jpg";
binmode FILE;
$content = join '' , <FILE>;
close FILE;
# stuff here
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift
ICQ: 4265451
FAX: (815) 846-2877
Rich Campbell <rcampbel@gbtech.net> wrote in message
news:01bebf6c$26ca06e0$c5dfffcc@upstairs...
> I want to modify some of the internal stuff in a ".jpg" file:
>
> something like:
> find the first "FF FE" in the file
> update the counter - which is the next (XX XX) after that
> INSERT MY text either immediately AFTER the XX XX
> or
> INSERT MY text at the end of the existing text data (which starts
> immediately after XX XX)
> the original text is (XX XX - 2) long - if there's NO existing text then
XX
> XX = 00 02
>
> then write the modified stuff out as a ".jpg" file again
>
> (note - this format assumes that the .jpg file has been processed with GWS
> Professional - it may NOT work with YOUR picture)
>
> ---------------
>
> I've tried "slurping" the file by:
>
> open(FD, "picture.jpg");
>
> undef $/;
>
> $file = <FD>;
>
> but no go (but it works fine for a .txt file)
>
> --------------
>
> Suggestions (Other than Perlfaq5 - been there)
------------------------------
Date: 26 Jun 1999 09:16:07 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: ACL access
Message-Id: <7l25on$1a6$1@gellyfish.btinternet.com>
On Sat, 26 Jun 1999 02:08:29 GMT okurios@my-deja.com wrote:
> Does anyone know how to access the ACL's under Solaris 7 from perl? I
> could not find anything at CPAN.
>
If there isnt anything on CPAN then there isnt anything ;-}
You will probably want to look at the documentation for ACL on your
system to discover how you can access them - Unfortunately I havent
got access to a Solaris machine right now and I aint gonna dial into
work just to find this out ...
When you have finished the module please submit it it to CPAN as I'm
sure that others will find it useful.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 09:19:25 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Active State perl and Personal Oracle 8
Message-Id: <7l25ut$1a9$1@gellyfish.btinternet.com>
On Sat, 26 Jun 1999 03:20:42 GMT sonigopi@hotmail.com wrote:
> I am running personal Oracle 8 and Active State perl on Stand alone pc.
> I having trouble connect to oracle from perl script. I am using DBI
> package. Below is the Script:
>
>
>
> use DBI ;
> $dbh=DBI->connect ( 'dbi:ODBC:beq-local' , 'scott' , 'tiger' ) ||
> die " Canm not Connect $DBI::errstr\n" ;
> $dbh->disconnect ;
>
You're not giving us much to go on here - I'm not quite sure what you
mean by 'having trouble connect to oracle' means precisely - it would
be useful if you told us what if any error message was printed out ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 11:12:27 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can not write my file to the server
Message-Id: <7l2cir$1vj$1@gellyfish.btinternet.com>
On Thu, 24 Jun 1999 22:22:45 +0100 Martin Quensel wrote:
> Jim Ray skrev i meddelandet ...
>>
>>Here's the code...
>>
>> open(DATA, ">>$dataname");
>>
>> foreach $argsa(@Save)
>> {
>> print DATA ("$argsa\n");
>> }
>> close DATA;
>>
> Dont know about NT but you are not creating a file, just appending to an
> existing one.
>
> loose one of those ">" and your file will be created i think
>
Nah, The append will create the file if it doesnt already exist in the
same manner as you had done a system open with the flags:
O_WRONLY | O_CREAT | O_APPEND
Whereas the single > is similar to:
O_WRONLY | O_CREAT | O_TRUNC
The original posters problem is almost certainly to do with with *where*
the file is being created ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 11:23:42 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Creating graphics on the fly for web pages
Message-Id: <7l2d7u$20t$1@gellyfish.btinternet.com>
On Thu, 24 Jun 1999 22:10:00 GMT boris_bass@my-deja.com wrote:
> What about GD library? Can anyone point me to good
> documentation/examlpes site?
>
The distribution of the GD module contains several good examples and
the documentation is pretty damn good too .
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 10:11:50 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Determining limit on size of data that a Perl CGI program can receive from a textarea form element
Message-Id: <7l2916$1oc$1@gellyfish.btinternet.com>
On Sat, 26 Jun 1999 18:46:13 +1000 Neale Morison wrote:
> It sends a large amount of data to the client browser and displays it in the
> textarea field, but when I try to submit the form, I get a "Connection with
> server reset" error under some circumstances.
> It seems to happen if the data exceeds a certain size, which varies between
> 15K and 40K.
> I'd love to edit files up to about 200K.
> Can anyone set me on the right track? Does the limitation come from:
> - The server
> - Perl
> - environment variables size limitations
> - The HTML protocol
> - The browser
> - The client O/S
> - Anything to do with specific characters in the textarea field, such as
> quotation marks
If it is any of the above with the exception of Perl then this question
is best asked in a group that is interested in one of those things.
However I think that I can confirm that it almost certainly isnt Perl -
and is almost certainly some arbitrary limit imposed on the size of
form fields by either the server or the browser - so I guess you will
probably want to ask in a group about one of those things.
Generally if you have a question about CGI you should first refer to
one or both of :
CGI Specification : <http://hoohoo.ncsa.uiuc.edu/cgi/>
CGI FAQ : <http://www.webthing.com/tutorials/cgifaq.html>
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 14:44:42 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Determining limit on size of data that a Perl CGI program can receive from a textarea form element
Message-Id: <7l3amb$9n2@news.cyber.net.pk>
If you are sending the form as GET, use POST. And if that doesn't help,
use form-data/multipart as enctype. (I have sent 2 mb of file over http
connection to a perl scripts, it works great!)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift
ICQ: 4265451
FAX: (815) 846-2877
Neale Morison <nmorison@ozemail.com.au> wrote in message
news:wt0d3.1309$vP.9248@ozemail.com.au...
> If this is off-topic, please excuse me. If so, I'd appreciate it if
someone
> could recommend a CGI group as good as this Perl group that might offer
the
> answer to this question.
>
> I have put together a Perl CGI script that uses a series of HTML Forms for
> web page management. It does everything I want, except for the bit where I
> want to allow users to edit the contents of the web page in a textarea
form
> element.
> It sends a large amount of data to the client browser and displays it in
the
> textarea field, but when I try to submit the form, I get a "Connection
with
> server reset" error under some circumstances.
> It seems to happen if the data exceeds a certain size, which varies
between
> 15K and 40K.
> I'd love to edit files up to about 200K.
> Can anyone set me on the right track? Does the limitation come from:
> - The server
> - Perl
> - environment variables size limitations
> - The HTML protocol
> - The browser
> - The client O/S
> - Anything to do with specific characters in the textarea field, such as
> quotation marks
> - my karma
>
>
>
>
>
------------------------------
Date: 26 Jun 1999 12:03:54 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Dynamic Page Generation
Message-Id: <7l2fjb$22s$1@gellyfish.btinternet.com>
On Thu, 24 Jun 1999 19:06:28 -0400 Laran Coates wrote:
> I'm writing a script to take fields from a form and populate and display
> another html page using those values.
This kind of thing is possibly among the simplest that could be achieved
using the CGI.
The general advice is to use the module CGI.pm that is included as
standard with all recent perl distributions - this module is well
documented with several good examples in the manpage.
Perhaps the simplest program that illustates the use of the module to
do something like that which you described would be:
#!/usr/bin/perl -w
use CGI qw/:standard/;
print header,
start_html("CGI Test"),
"\n";
print h1("CGI Test"),"\n";
print h2("Environment Variables"),"\n";
while (($key, $val) = each %ENV) {
print "$key = $val<BR>\n";
}
print h2("Parameters"),"\n";
for $name (param())
{
print "$name = ",param($name),"<BR>\n";
}
print end_html,"\n";
> I would ultimately like to have the
> script email the new document to an email address specified by the user.
>
Now you are opening a completely new can of worms. Consider for a moment
how this mechanism could be abused by someone wishing to spam or mailbomb
some recipient thus specified. You will need to think hard about how
you are going to prevent this kind of abuse - I would suggest that you
shouldnt actually allow the use of an arbitrary recipient. Of course
if this is to be used on a private network or with access controls to
prevent use by the unauthorised then you might be alright.
Having said that you should read waht it says in the document perlfaq9
about sending mail from a Perl program :
man perlfaq9
or
perldoc perlfaq9
or even if you dont have access on your local system (and why not ?)
then you will be able to find the full document set at :
<http://language.perl.com>
While you are at it you might take the opportunity to examine all of the
Perl documentation as this will help answer many questions you may
have in the future.
Something that isnt covered in the FAQ is the sending of files as mail
attachments - the generally recommended (ie easiest) way to do this
is by using the module MIME::Lite which is available from CPAN :
<http://www.perl.com/CPAN>
Generally speaking (despite my having answered your question here) any
questions regarding CGI should be directed to the newsgroup
comp.infosystems.www.authoring.cgi
regardless of what language you might be using. For matters on CGI
you might also find these resources valuable:
CGI FAQ
http://www.webthing.com/tutorials/cgifaq.html
Web FAQ
http://www.boutell.com/faq/
WWW Security FAQ
http://www.w3.org/Security/Faq/
HTTP Spec
http://www.w3.org/pub/WWW/Protocols/HTTP/
HTML Spec
http://www.w3.org/TR/REC-html40/
http://www.w3.org/pub/WWW/MarkUp/
CGI Spec
http://www.w3.org/CGI/
CGI Security FAQ
http://www.go2net.com/people/paulp/cgi-security/safe-cgi.txt
Actually these are listed in the first item of perlfaq9 but there you
go.
Good luck
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 11:27:24 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Error in my CGI that a can't find! Need help debugging!
Message-Id: <7l2des$210$1@gellyfish.btinternet.com>
On 24 Jun 1999 23:53:51 GMT Andrew Allen wrote:
>
> Are you a customer or slave to your webhoster? (Hint: are you paying
> money, or do you remember a 3-month journey chained at the bottom of a
> cargo ship?)
>
This brings a whole new meaning to the phrase 'Cargo Cult Programming' ;-}
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 10:47:20 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: format the output of scalar date/time
Message-Id: <7l2b3o$1ue$1@gellyfish.btinternet.com>
On Fri, 25 Jun 1999 08:25:52 GMT Nedret wrote:
> Hi, I am newby. Maybe the question is stupid though:
>
> I read date value from a database to a scalar and when a print it the
> result is like 1999-06-25 00:00:00. The same happens when I print scalar
> storing time. The result is 1800-12-31 14:23:40. How can I print the
> date and the time in the format I like.
Of ourse it all depends on what format it is that you like but in essence
it will all boil down to you splitting up your date/time strings into
the consituent parts and then printing them out in the way that you want:
#!/usr/bin/perl -w
use strict;
my $date = '1999-06-25 00:00:00';
my $time = '1800-12-31 14:23:40';
my ($year,$month,$day) = $date =~ /^(\d{4})-(\d{2})-(\d{2})/;
my ($hour,$mins,$secs) = $time =~ /(\d{2}):(\d{2}):(\d{2})$/;
printf("%02d/%02d/%04d",$day,$month,$year);
If you want to put the months into their names then you will probably
want to use an array to hold the names indexed on the $month value.
check out the manpages :
perlre
perlfunc
And also the bounteous perlfaq[1-9] while youre at it.
Or you'll get Tom Christiansen singing to you ... ;-}
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 04:58:36 -0400
From: esalmon@packet.net
Subject: I need help with pack!
Message-Id: <3774963C.E5F@packet.net>
I am trying to pack a string into a urlencoded or x-www-form-urlencoded
using the pack() function.
What am I doung wrong here:
$string =~ s/(\W)/pack("CH", ord('%'), ord($1))/eg;
Can anyone help?
Eric R. Salmon
PS: Reply by email, thanks!
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Jun 1999 09:54:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: installing Tk.pm
Message-Id: <7l27vt$1o3$1@gellyfish.btinternet.com>
On Fri, 25 Jun 1999 19:51:13 GMT Darrin Husmann wrote:
> attempting to install perl Tk.pm onto my HP-UX 10.20 system.
> I complete perl Makefile.PL
> However, when I try to then run "make", it returns:
>
> (ROOT:cx884007-c:/usr/apps/Tk800.014)--->make
> cd pTk && make
> cc -c -I.. -I. -Ibitmaps -DVERSION=\"800.014\"
> -DXS_VERSION=\"800.014\" -I/opt/perl5/lib/5.00503/PA-RISC1.1/CORE
> -Wall -Wno-implicit-int -Wno-comment -Wno-unused
> -D__USE_FIXED_PROTOTYPES__ Xlib_f.c
> In file included from tkPort.h:39,
> from Xlib_f.c:1:
> tkUnixPort.h:93: X11/cursorfont.h: No such file or directory
> tkUnixPort.h:94: X11/keysym.h: No such file or directory
> *** Error exit code 1
>
It looks very much like you are missing the X11 development system ...
That or the one you have is not standard.
Do you have a /usr/include/X11 directory at all ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 09:50:40 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Is dbi multi threaded?
Message-Id: <7l27pg$1o0$1@gellyfish.btinternet.com>
On Fri, 25 Jun 1999 23:09:39 GMT pedro@nospam.co.uk wrote:
> Do you still get multi-threading
> when you use dbi to access a
> multi-threaded database?
>
Err, DBI itself is a Multi-threaded as the perl that is using it,
however if you are talking to a Multithreaded database server such
as Informix Online then each instance of DBI (perhaps a thread,
perhaps a separate process) will use the separate threads in the
server as normal - and of course if the server will, say, parallelize
a complicated query into separate threads then this will happen whether
you are using DBI or some of client.
So I guess the answer is yes and no ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 14:46:34 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: large files (>2G), perl, solaris 2.6 x86
Message-Id: <7l3apt$9m1@news.cyber.net.pk>
Do not read the file at once!
open FILE , "2gbfile.txt" or die "not found";
while ( <FILE> )
{
# processing here
# $_ = line
}
close FILE;
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift
ICQ: 4265451
FAX: (815) 846-2877
Patrick Tufts <zippy@cs.brandeis.edu> wrote in message
news:7l17im$11e$1@new-news.cc.brandeis.edu...
> I find that when the file I want to open exceeds 2G, perl barfs when I
> attempt an:
>
> open <FILE> "<really-large-file" or die ...
>
> Based on similar problems reported here in the past (but with other
> operating systems), I bellieve the file postion associated with <FILE>
> is an int, and on this machine, 2G is greater than the size of int.
>
> What can I do? What is necessary to open large text files in Perl on
> this platform?
>
> I'm running Perl 5.005_02 built for i86pc-solaris
>
> Replies via email greatly appreciated. I will post a summary of
> responses here.
>
> --Pat
> Subject: large files (>2g), perl, solaris 2.6 x86
> Followup-To: poster
> Date: 25 Jun 1999 19:53:27 GMT
> Organization: Brandeis University, Waltham MA
> Lines: 22
> Message-ID: <7l0mnn$o2n$1@new-news.cc.brandeis.edu>
> NNTP-Posting-Host: spinel.cs.brandeis.edu
> Summary: want to open a large file (>2G) in perl, how?
> Xref: new-news.cc.brandeis.edu comp.lang.perl:2350
>
> I want to open a >2G flat text file in perl on solaris 2.6 (x86).
>
> I find that when the file I want to open exceeds 2G, perl barfs when I
> attempt an:
>
> open <FILE> "<really-large-file" or die ...
>
> Based on similar problems reported here in the past (but with other
> operating systems), I bellieve the file postion associated with <FILE>
> is an int, and on this machine, 2G is greater than the size of int.
>
> What can I do? What is necessary to open large text files in Perl on
> this platform?
>
> I'm running Perl 5.005_02 built for i86pc-solaris
>
> Replies via email greatly appreciated. I will post a summary of
> responses here.
>
> --Pat
------------------------------
Date: 26 Jun 1999 11:20:15 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: localtime (perldoc -f localtime didn't help)
Message-Id: <7l2d1f$20q$1@gellyfish.btinternet.com>
On Thu, 24 Jun 1999 13:05:12 -0600 Arcane wrote:
>
> I have the following perl program that when run on the commandline it
> returns the correct time, but once it is run through apache the time is
> an
> hour behind. This only happens on one of my computers and not the
> other two. I would guess it's some kind of TZ setting or daylight
> savings
> setting, but I don't know where it would be located at.
>
Try setting $ENV{'TZ'} to the appropriate vale at the beginning of
your program before using localtime().
You might want to ask on the group comp.infosystems.www.servers.unix
if there are any know workarounds for this in the Apache configuration.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 08:58:28 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Need some help on Sockets BSDI 4.0
Message-Id: <7l24nk$19t$1@gellyfish.btinternet.com>
On Fri, 25 Jun 1999 08:25:31 GMT ZepHead wrote:
> Our UPS server script was working fine until our host upgraded their OS
> now is doesn't work and appears to be a BSDI 4.0 socket problem.
>
> Our error code returns a Connect Failed
>
> I was thinking of doing this
>
> Old code line:
> $sockaddr = "S n a4 x8";
>
> New code line:
> $sockaddr = "x C n a4 x8";
>
>
> What are your thoughts and comments?
>
You should be using the Socket module - that defines the constants and
helper functions that will help to mek your code more independent of
the underlying system - most likely some of your hard coded values
have changed ....
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 08:55:32 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Net::SMTP - Adding a subject
Message-Id: <7l24i4$19q$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Kevin Kuebler <kkuebler@iwaynet.net> wrote:
> Hi,
>
> I just downloaded and installed the Net::SMTP module. After reviewing the
> documentation I created a test script and sent myself an email - worked
> great. The only problem is that I can't find any docs on how to include the
> subject line. Does anyone know the syntax for this?
>
Insert:
$smtp->datasend("Subject: Blah bblah\n\n");
At the appropriate point in your program ....
> Also when I run the script I get back an error msg to stdout that says:
> "The system cannot find the path specified"
That isnt a Perl message and I cant replicate it ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 10:51:28 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl script for URLs?
Message-Id: <7l2bbg$1uh$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Jon Skeet <skeet@pobox.com> wrote:
> fheitka@ibm.net wrote:
>> I'm looking for a perl script that will take a plain
>> text list of URLS and turn them in to a clickable
>> list that works in a browser like Netscape. Does
>> anyone know of such a beast?
>
> Not that I had one, but it's not the hardest script in the world to
> write :)
>
> #!/usr/bin/perl
>
> print "<html><body>\n";
>
> while (<>)
> {
> chomp;
> print "<a href=\"$_\">$_</a>\n";
> }
>
> print "</body></html>\n";
>
Of course it isnt anything to do with Perl but I think that you might
either want to replace that "\n" on every row with "<BR>\n" or use
a list as Bart suggested .
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 09:21:31 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: rename dose not work
Message-Id: <7l262r$1ac$1@gellyfish.btinternet.com>
On 25 Jun 1999 23:12:22 -0700 Tom Christiansen wrote:
> Still others allege that use of this hypothetical variable is copiously
> illustrated in roughly 5,273,742 different Perl programs for your perusal.
>
Wow! That many ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 03:43:55 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: Server Running Perl - Resources?
Message-Id: <3774AEEB.415A5D70@chatbase.com>
Troy Knight wrote:
>
> lol
>
<SNIP>
It's good to see you recognized the humor in my post, but perhaps you
can remove the 15KB of quoted text below your 3 character reply next
time?
--
Regards,
Tim Greer : webmaster@chatbase.com | software@linkworm.com
The ChatBase: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripts in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, +Sciences.
------------------------------
Date: Sat, 26 Jun 1999 10:52:30 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: should be how to remove ^M from middle of variable?
Message-Id: <3775b0a8.15685097@news.skynet.be>
John Callender wrote:
>> $val =~ s/\r//g; # remove ^M, the var is now 'unix like'
>> $val =~ s/\n/ /g; # subsitute newline with space
>
>If the person submitting the form is using a Mac, the above
>substitution will eliminate all the newlines and butt the end of one line
>up against the beginning of the next line, with no intervening space.
>So if you're going to do a substitution, you would probably prefer
>something like:
>
>$val =~ s/\r\n?/\n/g;
>$val =~ s/\n/ /g;
or, in one go:
s/\n|\r\n?/ /g;
Bart.
------------------------------
Date: 26 Jun 1999 09:05:25 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: syntax check without execution
Message-Id: <7l254l$1a2$1@gellyfish.btinternet.com>
On Fri, 25 Jun 1999 14:22:15 -0700 David Cassell wrote:
> Bart Lateur wrote:
>> [snip]
>> if(`$^X -c $file 2>&1` =~ "syntax OK") { ... }
>>
>> (not on a PC though... not unless "2>&1" works.)
>
> It doesn't with the M$ command.com running. But there are
> shells which run on PCs which will grok that (or something
> morally equivalent). 4NT comes to mind first...
>
Or even better GNU bash for djgpp ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 10:59:49 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: The Perlfaq Man Can! (was: problems with chmod function)
Message-Id: <3779b287.16163933@news.skynet.be>
Tom Christiansen wrote:
> David Cassell <cassell@mail.cor.epa.gov> writes:
>:"Tom Christiansen IS Gene Wilder!" - Rex Reed
>
>Thank God. I was afraid it'd be Barry Manilow.
Hmmm... I would have tought it was Sammy Davis Jr.
Bart.
------------------------------
Date: 26 Jun 1999 10:18:18 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: trapping "severe warnings"?
Message-Id: <7l29da$1oo$1@gellyfish.btinternet.com>
On Fri, 25 Jun 1999 14:29:22 -0400 Andrew S Gianni wrote:
> I'm writing a cgi app that tries to do an require on a few files. The
> requires are wrapped in an eval{} and it catches problems, but whenever
> I get a "severe warning" it always just spits it out. For example if I
> get a:
>
> syntax error at /some/file/name line 4, near "some_random_string"
>
> (a "fatal error") it catched it and it never come out on the page that's
> generated (I generate an error page if I can't do all the requires)
>
> However, I occasionaly get a:
>
> String found where operator expected
>
> kind of error (a "severe warning") and I can't trap it, and it just ends
> up printing it out before the top of the html document (or causing an
> internal server error if I don't set $| to a non-zero value). Any
> suggestions of things I could do to catch this so it doesn't show up on
> the page?
>
Of course the majority of these problems should be caught (and fixed)
before you try to run your programs on a server - if you are using
the module CGI.pm (as recommended by 9 out of 10 Perl breeders) then
it is easy to test the program at the command line, actually most of
the things that you describe above would be caught by simply running
your program at the command line with:
perl -cw myprog
You might also be interested in what it says in perlfaq9:
How can I get better error messages from a CGI program?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Jun 1999 09:59:31 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Using Perl with an ADVFS filesystem...
Message-Id: <7l28a3$1o6$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Lindsay Feuling <feuling@gcg.com> wrote:
> Hola.
>
> I am wondering if anyone in Perl-land has used their Perl code for
> file I/O on the Digital UNIX (Tru64, <-- insert newest OS name here)
> advfs (Advanced File System, great name, huh?) filesystem. And, if so,
> were there any problems with file I/O?
>
I wouldnt have thought so - as Perl is linked with the IO libraries of
your particular system then as long as those libraries work alright
with other applications then there is no reason that there should be
a problem with Perl. Of course I have no particular knowledge of
Digital Unix, so there might be something there I dont know about.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 26 Jun 1999 13:46:55 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Win32::OLE help needed
Message-Id: <t63d3.90$Tr2.551@news1.online.no>
Hi
I'm writing a perl program to extract data from a number of Excel-files and
I have run into a small annoyance. All the Excel-files contains automatic
links to information in another workbook, so Excel pops up a requester
asking me if I want to "update this workbook with changes made to the other
workbook".
Well, since this program is supposed to traverse through several directories
containing about 500 Excel-files, I'd really like to cancel these requesters
from perl, but I haven't got the faintest idea of how to interact with
requesters from perl.
So - any help and/or pointers to manuals will be appreciated.
Oh - my perl version is this:
-------------
This is perl, version 5.005_03 built for MSWin32-x86-object
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-1999, Larry Wall
Binary build 516 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 19:54:31 May 14 1999
-------------
--
Trond Michelsen
------------------------------
Date: 26 Jun 1999 11:16:10 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: WWWBoard for NT
Message-Id: <7l2cpq$20n$1@gellyfish.btinternet.com>
On Thu, 24 Jun 1999 14:21:47 -0400 David Spivey wrote:
> I am looking for somewhere that has a message board (WWWBoard) that I can
> download to use on my NT Server v. 4.0. All of the WWWboard's online are
> comaptible only with Unix and I need one that has been written with NT in
> mind. Any help would be greatly appreciated.
You might want to look at the perlport manpage to determine the things
that might need to be changed between Unix and Windows and if any of those
things are really show stoppers - I think you'll find that there are
very few things that will need to be changed.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 6134
**************************************