[15501] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2911 Volume: 9

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

Date: Sun, 30 Apr 2000 21:05:13 -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: <957153913-v9-i2911@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 30 Apr 2000     Volume: 9 Number: 2911

Today's topics:
    Re: "@str" not printing first value of array back to st <rick.delaney@home.com>
        "@str" not printing first value of array back to stdout <jb@datatap.com>
    Re: "@str" not printing first value of array back to st (Tad McClellan)
        [IMPORTANT] Content-type to download an image! <makau@multimania.com>
    Re: [IMPORTANT] Content-type to download an image! (Craig Berry)
    Re: [IMPORTANT] Content-type to download an image! <makau@multimania.com>
    Re: [IMPORTANT] Content-type to download an image! <tony_curtis32@yahoo.com>
        CGI.pm and -w <webmaster@momsathome.on.ca>
    Re: CGI.pm and -w <wyzelli@yahoo.com>
    Re: CGI.pm and -w <tony_curtis32@yahoo.com>
    Re: CGI.pm and -w <care227@attglobal.net>
    Re: CGI.pm and -w <jeff@vpservices.com>
    Re: Combining strings = Win32::OLE=HASH geoffpollard@my-deja.com
        Create a file that Read/Write Properties are set to yes <frichard@comwerx.net>
        Documenting Cron <dougtho@geocities.com>
    Re: Documenting Cron <htp@mac.com>
    Re: exception handling <gellyfish@gellyfish.com>
        how to count number of characters in a string? <schan_ca@geocities.com>
    Re: how to count number of characters in a string? <tony_curtis32@yahoo.com>
    Re: how to count number of characters in a string? <schan_ca@geocities.com>
    Re: how to count number of characters in a string? <jeff@vpservices.com>
    Re: how to get a reference to an object's method and us <schan_ca@geocities.com>
    Re: how to send a mail attache a file without modules <gellyfish@gellyfish.com>
    Re: how to send a mail attache a file without modules (Michael Budash)
    Re: Installing Perl <jwillmore@cyberia.com>
    Re: Is there a script for testing DNS entries <gellyfish@gellyfish.com>
    Re: man2html <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 30 Apr 2000 21:08:12 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: "@str" not printing first value of array back to stdout? w/  actives..perl  dos-prompt
Message-Id: <390CA184.9E19AE77@home.com>

[posted & mailed]

jb wrote:
> 
> 1 Why the shift to the left in the first value "a" of the array?

perldoc perlfaq5

    Why do I get weird spaces when I print an array of lines?

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Sun, 30 Apr 2000 12:58:04 -0700
From: "jb" <jb@datatap.com>
Subject: "@str" not printing first value of array back to stdout? w/ actives..perl  dos-prompt
Message-Id: <sgp3pnnli5079@corp.supernews.com>

Ok on win 98 with ActiveState perl 5.004 while working from the MS-DOS
prompt window I am running a program called rev.pl  (code at end of
question).

at the ms-dos prompt I type:

perl rev.pl
a
b
c
d
ctrl z (note this doesn't echo it stops the input and begins the output
similar to ctrl d in unix?)

on the same line that ctrl z is typed in my msdos window I get the "b"
followed by et al...
 b
 c
 d
 ---
a
 b
 c
 d
 ---

where as the file output.txt shows.

a
 b
 c
 d
 ---
a
 b
 c
 d
 ---

Two questions:
1 Why the shift to the left in the first value "a" of the array?
2 Why doesn't the first value of the array show up in my MS-DOS window?


tia,

jb


#########
You can see the code  below.
#########


#!/usr/bin/perl
# NAME rev.pl
use strict;

my (@str);

open (OP, ">>output.txt");

@str = <>;

print  OP "@str ---\n";

print "@str---\n";

print  OP "@str ---\n";

print "@str---\n";

close OP;

exec 'notepad.exe', "output.txt";

exit;




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

Date: Sun, 30 Apr 2000 20:21:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: "@str" not printing first value of array back to stdout? w/ actives..perl  dos-prompt
Message-Id: <slrn8gpjgo.7kc.tadmc@magna.metronet.com>

On Sun, 30 Apr 2000 12:58:04 -0700, jb <jb@datatap.com> wrote:

>Two questions:

One answer:


>1 Why the shift to the left in the first value "a" of the array?


   See the description of the $" special variable in
   perlvar.pod.

   
>2 Why doesn't the first value of the array show up in my MS-DOS window?


I dunno.


>#!/usr/bin/perl

You are missing a -w switch there.


>use strict;


That's Very Good though!


>print  OP "@str ---\n";
            ^^^^
            ^^^^ array values interpolated into a double-quoted string


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 30 Apr 2000 22:35:38 GMT
From: Makau Divangamene <makau@multimania.com>
Subject: [IMPORTANT] Content-type to download an image!
Message-Id: <8eicfp$bv2$1@nnrp1.deja.com>

What is the Content-type to download an image?

By doing :
--
my $logo = './logo.gif';

print "Content-type: foobar/gif\n\n";
open (IMAGE,$logo) or die $!;
print while (<IMAGE>);
close (IMAGE);
--

Netscape downloads the image because it doesn't know what type it is.
But Internet Explorer fails to do that and hangs :(((

Is there a special Content-type to use to make Internet Explorer
actually DOWNLOAD the image?

Huge thanks in advance! It is extremely important to me!!

/Makau


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


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

Date: Sun, 30 Apr 2000 23:31:47 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: [IMPORTANT] Content-type to download an image!
Message-Id: <sgpgj3n9oog32@corp.supernews.com>

Makau Divangamene (makau@multimania.com) wrote:
: What is the Content-type to download an image?

Um, how about 'image'? :)  Specifically, 'image/gif', 'image/jpeg', and so
forth.

: By doing :
: --
: my $logo = './logo.gif';

Note that the current working directory (.) is not defined by the CGI
spec.  So using relative paths is perilous; it may work on one server, and
then fail miserably on another.  And yes, this stinks...it's one of my
least favorite things about CGI programming.

: print "Content-type: foobar/gif\n\n";
: open (IMAGE,$logo) or die $!;

You might wish to try the open before sending the header, and send a text
or html response if the open fails.  This increases the odds that
something useful will appear, on some browsers, in some circumstances,
maybe. :)

: print while (<IMAGE>);

Not a good idea.  The image is a binary file, which may include e.g.
internal eof markers on Windows systems,  The 'while (<>)' image is meant
for text files.  Use read() instead.

-- 
   |   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: Mon, 01 May 2000 01:01:32 GMT
From: Makau Divangamene <makau@multimania.com>
Subject: Re: [IMPORTANT] Content-type to download an image!
Message-Id: <8eil15$ku5$1@nnrp1.deja.com>


> : What is the Content-type to download an image?
>
> Um, how about 'image'? :)  Specifically, 'image/gif', 'image/jpeg',
> and so forth.

Hey Craig,

Thank you for your reply!
Unfortunately it didn't help too much because what I wanted to do
DOWNLOAD an image, not VIEW it! Precisely I wanted the browser to
prompt the user to download it.

But happily for me I found the answer in the CGI-Authoring group, which
my question really belonged to.

So if anyone cares, here is the working (crossbrowser) code :

--
my $logo  = "logo.gif";

open (IMAGE,$logo) or die $!;
print "Content-type: application/download\n";
print "Content-Disposition: attachment; filename=logo.gif\n\n";
binmode(IMAGE);
print <IMAGE>;
close (IMAGE);
--

/Makau.

PS : I didn't use your suggested read() function since I don't know how
to use it. Also it seems impossible to use "die" to send and html error
message (the directive 'or die "Content-type:
text/html\n\n<HTML><BODY>Error</BODY></HTML>"' can't seem to work)


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


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

Date: 30 Apr 2000 20:19:32 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: [IMPORTANT] Content-type to download an image!
Message-Id: <87bt2r12zf.fsf@shleppie.uh.edu>

>> On Mon, 01 May 2000 01:01:32 GMT,
>> Makau Divangamene <makau@multimania.com> said:

>> : What is the Content-type to download an image?
>> 
>> Um, how about 'image'? :) Specifically, 'image/gif',
>> 'image/jpeg', and so forth.

> Thank you for your reply!  Unfortunately it didn't help
> too much because what I wanted to do DOWNLOAD an image,
> not VIEW it! Precisely I wanted the browser to prompt
> the user to download it.

You can't force a browser to do something from the
server-side.  If the client side wants to `view' an
image/gif stream then it will, likewise if it wants to
`download' it, it will, no matter what you send.

> PS : I didn't use your suggested read() function since I
> don't know how to use it. Also it seems impossible to
> use "die" to send and html error message (the directive
> 'or die "Content-type:
> text/html\n\n<HTML><BODY>Error</BODY></HTML>"' can't
> seem to work)

perldoc CGI::Carp

hth
t


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

Date: Sun, 30 Apr 2000 21:24:57 -0400
From: Jennifer <webmaster@momsathome.on.ca>
Subject: CGI.pm and -w
Message-Id: <390CDCE9.584969EA@momsathome.on.ca>

I'm using the following statements at the top of my scripts.
$CGI::POST_MAX=1024 * 1000;  # max 1M posts
$CGI::DISABLE_UPLOADS = 1;  # no uploads

Except now I am getting tons of warnings in my logs that they are
only used once and may be a typo. I'm also using CGI::Carp
qw(fatalsToBrowser) and  -w Is there some way to stop these
errors aside from removing the fatalsToBrowser or -w?

Jennifer


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

Date: Mon, 1 May 2000 11:06:42 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: CGI.pm and -w
Message-Id: <Lc5P4.12$O47.1262@vic.nntp.telstra.net>

Jennifer <webmaster@momsathome.on.ca> wrote in message
news:390CDCE9.584969EA@momsathome.on.ca...
> I'm using the following statements at the top of my scripts.
> $CGI::POST_MAX=1024 * 1000;  # max 1M posts
> $CGI::DISABLE_UPLOADS = 1;  # no uploads
>
> Except now I am getting tons of warnings in my logs that they are
> only used once and may be a typo. I'm also using CGI::Carp
> qw(fatalsToBrowser) and  -w Is there some way to stop these
> errors aside from removing the fatalsToBrowser or -w?
>

If you have exclusive use of the CGI module you can set those variables
within the module itself.  Otherwise, you can cludge it by using the
variable name twice.

Wyzelli




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

Date: 30 Apr 2000 20:46:04 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: CGI.pm and -w
Message-Id: <8766sz11r7.fsf@shleppie.uh.edu>

>> On Sun, 30 Apr 2000 21:24:57 -0400,
>> Jennifer <webmaster@momsathome.on.ca> said:

> I'm using the following statements at the top of my
> scripts.  $CGI::POST_MAX=1024 * 1000; # max 1M posts
> $CGI::DISABLE_UPLOADS = 1; # no uploads

> Except now I am getting tons of warnings in my logs that
> they are only used once and may be a typo.

Could you show some small code that demonstrates this
behaviour?  The following works fine for me:

    #!/usr/bin/perl -w
    use strict;
    use CGI qw(:standard);
    
    $CGI::POST_MAX=1024 * 1000;  # max 1M posts
    $CGI::DISABLE_UPLOADS = 1;  # no uploads
    
    print header(); # for example

$ perl -cwT <this-script>
<this-script> syntax OK
$ ./<this-script> =
(offline mode: enter name=value pairs on standard input)
Content-Type: text/html

$ perl -v
 ...
This is perl, v5.6.0 built for i586-linux
 ...

[I get the same behaviour with 5.004 on another machine]

hth
t


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

Date: Sun, 30 Apr 2000 22:15:15 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: CGI.pm and -w
Message-Id: <390CE8B3.C44E4C7A@attglobal.net>

Jennifer wrote:
> 
> I'm using the following statements at the top of my scripts.
> $CGI::POST_MAX=1024 * 1000;  # max 1M posts
> $CGI::DISABLE_UPLOADS = 1;  # no uploads
> 
> Except now I am getting tons of warnings in my logs that they are
> only used once and may be a typo. I'm also using CGI::Carp
> qw(fatalsToBrowser) and  -w Is there some way to stop these
> errors aside from removing the fatalsToBrowser or -w?

To stop the compiler warnings (-w) you could, as previously
suggested, use the variables twice (wastefull, I think) or 
you could enclose these in a block and then turn off warnings 
for that block by setting the special variable $^W to 0. 

If you do that, make sure you use the 'local' directive so you 
don't change the main $^W.  

HTH


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

Date: Sun, 30 Apr 2000 19:25:22 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: CGI.pm and -w
Message-Id: <390CEB12.A7C0BDE6@vpservices.com>

Tony Curtis wrote:
> 
> >> On Sun, 30 Apr 2000 21:24:57 -0400,
> >> Jennifer <webmaster@momsathome.on.ca> said:
> 
> > I'm using the following statements at the top of my
> > scripts.  $CGI::POST_MAX=1024 * 1000; # max 1M posts
> > $CGI::DISABLE_UPLOADS = 1; # no uploads
> 
> > Except now I am getting tons of warnings in my logs that
> > they are only used once and may be a typo.
> 
> Could you show some small code that demonstrates this
> behaviour?  The following works fine for me:
> 
> [snip example of -w and strict safe use of those variables]

Yeah, it works for me too.  I seem to remember having had problems with
this in the past though so perhaps it depends on the version of CGI.pm. 
Mine is 2.56 with activePerl build 522 on win98.

-- 
Jeff


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

Date: Mon, 01 May 2000 03:28:01 GMT
From: geoffpollard@my-deja.com
Subject: Re: Combining strings = Win32::OLE=HASH
Message-Id: <8eitjj$u5c$1@nnrp1.deja.com>

This should work...

$myvar1 = $Request->Form('title')->Item;
$myvar2 = $Request->Form('from')->Item;


In article <8e9lr9$3kq$1@nnrp1.deja.com>,
  b_stark@my-deja.com wrote:
> I know hardly anything about perl... but I need
> to get a simple script to work that sends an E-
> mail from data received from a form. Simple
> enough... but when I combine strings together,
> all I get is Win32::OLE=HASH(address) x2. Here is
> a sample:
>
> $myvar1 = $Request->Form('title');
> $myvar2 = $Request->Form('from');
>
> $result = $myvar1.$myvar2;
> $Response->Write ($result);
>
> If the name in the from field is Brad Stark and
> the title is MR. I would expect to get Mr. Brad
> Stark... but instead I get Win32::OLE=HASH
> (0x172ab50)Win32::OLE=HASH(0x172ab8c) Anyone have
> a clue what is happening?
>
> Thanks in advance.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


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


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

Date: Sun, 30 Apr 2000 21:55:37 -0700
From: "Leroux" <frichard@comwerx.net>
Subject: Create a file that Read/Write Properties are set to yes
Message-Id: <Ht6P4.2850$cO.14601@newsfeed.slurp.net>

I never had this problem before.  I've always been able to automatically
write to a file that is dynamically created with a script something like
this;

open(OUTPUT_FILE, ">>/disk1/f/public_html//$flemail") or die("Unable to open
Guestbook data file /disk1/f/public_html//$flemail");

where $flemail is the name of the file.  It will not create the file and
allow me to write to it.  Gee wiz wally.

Thanks,
frichard@comwerx.net
Freddie L Richard




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

Date: Sun, 30 Apr 2000 17:49:07 -0600
From: "Doug Thomas" <dougtho@geocities.com>
Subject: Documenting Cron
Message-Id: <LB3P4.543$Go2.9723@news.uswest.net>

Hello,

Does anyone have a program/script to document the crontab listing? For
instance, it would show jobs which run on specific weekdays, days of the
month, or every day. If not, I'll write one. An example follows:

Monday
-----------
8:00 AM My job 1

Saturday
------------
2:30 AM My job 2

Wednesday and Thursday
------------
1:00 AM and every 10 minutes  My job 3

Every day
------------
9:15 PM  My job 4

Any help is appreciated.




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

Date: Mon, 01 May 2000 11:36:48 +0930
From: Henry <htp@mac.com>
Subject: Re: Documenting Cron
Message-Id: <htp-A5E1D9.11364801052000@news.metropolis.net.au>

In article <LB3P4.543$Go2.9723@news.uswest.net>, "Doug Thomas" 
<dougtho@geocities.com> wrote:

> Does anyone have a program/script to document the crontab listing?

[linux]$ man 5 crontab

Henry.


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

Date: 26 Apr 2000 21:52:10 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: exception handling
Message-Id: <8e7ktq$u3d$1@orpheus.gellyfish.com>

On Tue, 25 Apr 2000 13:13:11 -0700 Makarand Kulkarni wrote:
>>     Hey people. I'm planning an OO Perl app, and I want real exception
>> handling with full objects. I've looked at the CPAN, and I see Exceptions.pm,
>> and Error.pm. They look very much alike. Did I miss anything else? Does anyone
>> have any favorites?
>>     I also saw a news post about a Throwable.pm module. Anything on that?
> 
> Exception handling in perl is not very object aware.
> Check this
> 
> http://genome-www.stanford.edu/perlOOP/lib/Bio/Root/Err.pm.html

There was also a thread here about this some time around the New Year,
perhaps the person who brought it up then will 'fess up but I'll put
Clinton Pierce in the frame in the frame anyway as there's nothing better
than making something up to get the right answer ;-}

(Sorry Clint if it want you :0)

/J\
-- 
Let me handle this, Marge, I've heard 'em all. ''I like you as a
friend.'' ''I think we should see other people.'' ''I don't speak
English.'' ''I'm married to the sea.'' ''I don't wanna kill you, but I
will.'' ... Six simple words: I'm not gay, but I'll learn.
-- 
fortune oscar homer


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

Date: Mon, 01 May 2000 00:55:37 GMT
From: steve <schan_ca@geocities.com>
Subject: how to count number of characters in a string?
Message-Id: <390CD755.E8A24225@geocities.com>

Hello:

How do I go about counting the number of characters in a string?

Thanks
Steve






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

Date: 30 Apr 2000 19:59:25 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: how to count number of characters in a string?
Message-Id: <87zoqb84r6.fsf@shleppie.uh.edu>

>> On Mon, 01 May 2000 00:55:37 GMT,
>> steve <schan_ca@geocities.com> said:

> Hello: How do I go about counting the number of
> characters in a string?

You mean the *length* of a string?

 $ perldoc -q length

The answer may not surprise you.

Or do you want to count _specific_ occurrences of chars
within a string?

hth
t



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

Date: Mon, 01 May 2000 02:23:05 GMT
From: steve <schan_ca@geocities.com>
Subject: Re: how to count number of characters in a string?
Message-Id: <390CEBD6.AE0EECB2@geocities.com>

Length is what I am looking for.
Thanks.

I keep thinking this is Perl so there must
be some regexp I have to do.

Thanks
Steve
---------------------------------


Tony Curtis wrote:

> >> On Mon, 01 May 2000 00:55:37 GMT,
> >> steve <schan_ca@geocities.com> said:
>
> > Hello: How do I go about counting the number of
> > characters in a string?
>
> You mean the *length* of a string?
>
>  $ perldoc -q length
>
> The answer may not surprise you.
>
> Or do you want to count _specific_ occurrences of chars
> within a string?
>
> hth
> t



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

Date: Sun, 30 Apr 2000 19:28:59 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: how to count number of characters in a string?
Message-Id: <390CEBEB.BC7828C5@vpservices.com>

steve wrote:
> 
> Length is what I am looking for.
> Thanks.

You said it, not me.  Length is what you are looking for:

     print length "abc";

Prints 3, as one might expect.

-- 
Jeff


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

Date: Sun, 30 Apr 2000 21:01:21 GMT
From: steve <schan_ca@geocities.com>
Subject: Re: how to get a reference to an object's method and use it?
Message-Id: <390CA06D.136AA46D@geocities.com>

You are right! I missed the forest for the trees.
I made a test program and found param()  will
return either POST or GET accordingly.
Sorry.
Steve
=======================================

"Alan J. Flavell" wrote:

> On Sun, 30 Apr 2000, steve wrote:
>
> [much quotage, now radically snipped]
>
> > Tom Phoenix wrote:
>
> > > Instead, use the function-oriented interface:
>
> > I think I'll take your suggestion and use the function-oriented interface:
>
> No dispute there...
>
> > I am a long time cgi-lib.pl user, but for no particular reason decided to
> > try CGI.pm for my current project.
>
> You should, you should.
>
> > I really don't care for the OO feature of CGI.pm and it's size.
>
> Its size isn't really an issue.  It has various tricks up its sleeve
> to promote efficiency.  If your scripts have response-time problems
> then you need to be looking at other parts of the setup in order to
> solve that.
>
> > The reason I wanted to get a reference to a CGI.pm object's method is
> > I need to process either POST or GET in the same script depending
> > on   query->request_method()  .  To get POST parameters, I call
> > query->param()   and for GET parameters I call  query->url_param().
>
> I think you've taken a wrong path at some point and can't see the wood
> for the trees.  If you're using GET and POST in a normal way, then
> CGI.pm will give you your query parameters transparently, you don't
> need to even check which method is in use, just use them.
>
> There's an obscure bit in the CGI.pm documentation, "Mixing POST and
> URL Parameters", that discusses the use of a query string in
> conjunction with POST, which it appears you must have been looking at.
> I'd say quite simply "don't do that", and then you won't need to worry
> about it.
>
> Did you even need to look at the param() string yourself anyway?
> CGI.pm parses it for you and offers it to you in a more digestible
> form, which is ideal for many purposes.  Perhaps if you'd say more
> about what you're trying to achieve, rather than concentrating on some
> details of how you're struggling to achieve it, you might get some
> better advice on that.
>
> good luck



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

Date: 26 Apr 2000 22:01:07 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to send a mail attache a file without modules
Message-Id: <8e7lej$vqd$1@orpheus.gellyfish.com>

On Wed, 26 Apr 2000 12:31:03 +0800 netnews wrote:
> How could I send a mail attache a file just using sendmail and perl,and
> without using modules?

By supplying the correct MIME encoded message to sendmail I would imagine
however what that encoding might be is something you will want to take
up with the RFCs that describe MIME or in a Newsgroup in comp.mail.* that
discusses these matters.

I would recommend that you use the module MIME::Lite and ask us to help
you overcome the problems you have with using modules instead.

/J\
-- 
What is abnormal in Life stands in normal relations to Art. It is the
only thing in Life that stands in normal relations to Art.
-- 
fortune oscar homer


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

Date: Sun, 30 Apr 2000 19:53:59 -0700
From: mbudash@wcws.com (Michael Budash)
Subject: Re: how to send a mail attache a file without modules
Message-Id: <mbudash-3004001953590001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article <8e7lej$vqd$1@orpheus.gellyfish.com>, Jonathan Stowe
<gellyfish@gellyfish.com> wrote:

> On Wed, 26 Apr 2000 12:31:03 +0800 netnews wrote:
> > How could I send a mail attache a file just using sendmail and perl,and
> > without using modules?
> 
> By supplying the correct MIME encoded message to sendmail I would imagine
> however what that encoding might be is something you will want to take
> up with the RFCs that describe MIME or in a Newsgroup in comp.mail.* that
> discusses these matters.
> 
> I would recommend that you use the module MIME::Lite and ask us to help
> you overcome the problems you have with using modules instead.
> 
> /J\

i agree. use a module. i did it without a module, and it took forever...

my .02
-- 
Michael Budash ~~~~~~~~~~ mbudash@wcws.com


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

Date: Sun, 30 Apr 2000 15:22:35 -0400
From: James Willmore <jwillmore@cyberia.com>
To: pamfae@my-deja.com
Subject: Re: Installing Perl
Message-Id: <390C87FB.4089B1B6@cyberia.com>

First, do you have a directory called "Perl".  I don't know what the
directory would be called with the latest build of Perl, but for Build 522
the perl interpreter and all the modules are in a directory called Perl.
If you have this, then you have installed Perl.

In reference to using Perl from DOS - yes, you run it from DOS.  You may
want to take the time and read the documentation provided from ActiveState
and from the Perl Home page (http://www.perl.com/).

Do not be insulted by the following example.  It may be simple for you,
but may benefit others in a similar situation.

To start you out:

1)    open a DOS prompt
2)    type "edit"
3)    type in the following:

                #!c:\perl\bin\perl

                print "Hello World\n";

4)    save the file as hello.pl in a directory of your choice
5)    change directory to the directory with hello.pl
        ("cd <insert directory name here>")
6) type "c:\perl\bin\perl hello.pl"

The desired output should be:

        Hello World


===============================
pamfae@my-deja.com wrote:

> Hello,
>
> I am sorry if this question has been asked five million times. Believe
> me, I searched for help before asking.
>
> I have installed activestate perl build 613 to my win98 operating
> system. In program manager the only thing I see is "Documentation". I
> don't know what my next step is.
>
> I went to the ActiveState site, as well as many other areas with FAQs
> and none seem to offer basic 'what do I do next' information.
>
> Also, activestate says the build needs a ppm fix. I downloaded that,
> and followed directions as nearly as I could without progress. Could
> someone please inform me exactly what to do next?
>
> Do I have to use the compiler/interpreter from a dos command prompt? I
> tried doing that with ppmfix and got error messages. But I think that
> is my own ignorance of dos, because I couldn't get a simple text file
> to display either.
>
> (I was under the impression that you just typed the path of the file,
> and it's name if it's text, for DOS to print out? No?) Please help me.
>
> Thank you.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



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

Date: 26 Apr 2000 22:04:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Is there a script for testing DNS entries
Message-Id: <8e7lk6$m6$1@orpheus.gellyfish.com>

On Wed, 26 Apr 2000 09:59:29 +0100 Colin Sabine wrote:
> Hi
> Does any one know of a script that scans through a DNS zone file and tests
> to see if a host is alive. I know this would be simple to write, but hey why
> re-invent the wheel!
> 

You can use the module DNS::ZoneFile to get the 'A' records from a zonefile
and Net::Ping to see if the host is 'alive'.  About ten lines of code if
you use those modules I would say.

Have fun

/J\
-- 
Marge, I'm going to miss you so much. And it's not just the sex. It's
also the food preparation.
-- 
fortune oscar homer


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

Date: 26 Apr 2000 21:36:29 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: man2html
Message-Id: <8e7k0d$r3f$1@orpheus.gellyfish.com>

[ Totally reformatted post - please set your line wrap correctly and
  reply after the text you are replying to after editing ]

On Wed, 26 Apr 2000 14:22:03 GMT Ira Weiner wrote:
> Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
> news:8e4ucl$soe$1@orpheus.gellyfish.com...
>> On Tue, 25 Apr 2000 12:33:42 GMT Ira Weiner wrote:
>> >
>> > The version I have appears to work such that I need to "man <command>
>> > | man2html" and man2html reads stdout and formats it to HTML.
>> > I wrote a simple script to do this, but it does not recognize my
>> > environment variable.  I guess the question now becomes: how to
>> > pass an environment variable from a browswer to a UNIX script
>> >
>> > #!/bin/bash 
>> > /usr/bin/man  $1 | ./man2html
>>
>>
>> Quite honestly I wouldnt bother ;-}  If you get the latest version of
>> 'groff' then you can do :
>>
>>    groff -man -Thtml /usr/man/man1/red.1
>>
>> For instance and cut out the middle man.
>>
>> If you are using a version of 'man' that supports it you
>> could use the '-w' flag to get the path of the file that man would use.
>>
>> Of course you could wrap all this in a Perl program.
>>
>>
> Thanks.  I have an older version of groff, and it doesn't recognize
> the -Thtml flag.
> 

Well get hold of a more recent one then.  Its free.  It'll compile out
of the tarball on Linux and once you've used it you'll never want to
touch MS Word again <huh ?>

> Wouldn't that leave me with the same problem, though, of how to pass a
> variable from the CGI environment to a UNIX script?
> 

Then use the module CGI.pm to get the parameters.  If you can get your
head round what it says in the manual then you'll be fine.  CGI.pm has
been distributed with perl since 5.00404 you are bound to have it.

Try :

  man CGI

Or

  perldoc CGI

For starters.

You could do this in about ten lines of code and everything is explained
in the documentation for the above module.

If you have more general questions about CGI as a whole you will be better
off asking in comp.infosystems.www.authoring.cgi .

/J\
-- 
Education is an admirable thing. But it is well to remember that nothing
that is worth knowing can be taught.
-- 
fortune oscar homer


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

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


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