[17049] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4461 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 28 18:06:07 2000

Date: Thu, 28 Sep 2000 15:05:19 -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: <970178718-v9-i4461@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 28 Sep 2000     Volume: 9 Number: 4461

Today's topics:
        a simple perl nodo70@my-deja.com
    Re: a simple perl <lr@hpl.hp.com>
    Re: accessing global variables in another perl module <jasoniversen@my-deja.com>
    Re: An interesting situtation!!! Please help me!!! (Richard J. Rauenzahn)
    Re: An interesting situtation!!! Please help me!!! <lr@hpl.hp.com>
        Better way to split <gopalan@cs.sc.edu>
    Re: Better way to split <jeffp@crusoe.net>
    Re: Better way to split (Garry Williams)
    Re: Candidate for the top ten perl mistakes list (Ilya Zakharevich)
    Re: Candidate for the top ten perl mistakes list (Ilya Zakharevich)
        connecting to Verisign's PayFlo Pro - anybody? <news@nebulus.org>
        dbi modules frescot@my-deja.com
    Re: dbi modules <jeff@vpservices.com>
    Re: enter-key in forms <dsimonis@fiderus.com>
    Re: enter-key in forms <flavell@mail.cern.ch>
    Re: freeware perl script to binary... <gellyfish@gellyfish.com>
        function reference <chalesx@yahoo.com>
        global variable nlymbo@my-deja.com
        How to do a UDP broadcast using IO::Socket? <franl-removethis@world.omitthis.std.com>
    Re: How to get length of scalar? <juex@deja.com>
    Re: How to get length of scalar? (Jerome O'Neil)
    Re: How to get length of scalar? (Arthur Darren Dunham)
    Re: How to get length of scalar? <uri@sysarch.com>
    Re: How to get length of scalar? (Craig Berry)
    Re: How to get length of scalar? (Andrew Johnson)
    Re: How to monitor end of text file mikewise99@my-deja.com
        HTML Email joshfeingold@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 28 Sep 2000 18:33:49 GMT
From: nodo70@my-deja.com
Subject: a simple perl
Message-Id: <8r02ud$foe$1@nnrp1.deja.com>

How come the script below doesn't work if I want to set up a variable
DATESTAMP to the current date in environment?  Please advise.  Thanks.

#!/usr/local/bin/perl
$DATE_STAMP = &now();

print "Setting current date stamp...\n";
`set DATESTAMP=$DATE_STAMP`;
exit 0;

#-----------------------------------------------------------------------
--------
# now subroutine: to print out a string containing date in form of
mmdd.hhmmss
#-----------------------------------------------------------------------
--------
sub now {
    local ($sec, $min, $hour, $mday, $mon, $year) = localtime (time);
    #$year = $year + 1900;
    #my ($yearFormat) = substr($yearFormat, -2, 2);
    sprintf ("%2.2d-%2.2d-%2.2d", $mon+1, $mday, substr($year + 1900, -
2));
}


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


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

Date: Thu, 28 Sep 2000 12:29:00 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: a simple perl
Message-Id: <MPG.143d3bdc8b575c7e98add3@nntp.hpl.hp.com>

[Not much of a subject!  Perl isn't all that simple.  :-]

In article <8r02ud$foe$1@nnrp1.deja.com> on Thu, 28 Sep 2000 18:33:49 
GMT, nodo70@my-deja.com <nodo70@my-deja.com> says...
> How come the script below doesn't work if I want to set up a variable
> DATESTAMP to the current date in environment?  Please advise.  Thanks.
> 
> #!/usr/local/bin/perl

Add '-w' and 'use strict;' and more people will respect you.  :-)

> $DATE_STAMP = &now();
> 
> print "Setting current date stamp...\n";
> `set DATESTAMP=$DATE_STAMP`;

That spawns a subprocess, changes *its* environment, and returns.  Not 
what you want.  (By the way, using backticks in void context is frowned 
on.  perldoc -f system)

> exit 0;

The above is unnecessary but harmless.  Consider it to be 
'documentation'.
 
> #-----------------------------------------------------------------------
> --------
> # now subroutine: to print out a string containing date in form of
> mmdd.hhmmss
> #-----------------------------------------------------------------------
> --------
> sub now {
>     local ($sec, $min, $hour, $mday, $mon, $year) = localtime (time);

perlfaq7: "What's the difference between dynamic and lexical (static) 
scoping? Between local() and my()?"

time() is the default for localtime(), and you can slice out only the 
values you need:

      my ($mday, $mon, $year) = (localtime)[3 .. 5];

>     #$year = $year + 1900;
>     #my ($yearFormat) = substr($yearFormat, -2, 2);
>     sprintf ("%2.2d-%2.2d-%2.2d", $mon+1, $mday, substr($year + 1900, -
> 2));

      sprintf '%.2d-%.2d-%.2d', $mon + 1, $mday, $year % 100;

> }

Oh, yes, what we've all been waiting for -- the answer to your question:

  $ENV{DATESTAMP} = now();

Look in perlvar for %ENV.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 28 Sep 2000 21:30:14 GMT
From: jason iversen <jasoniversen@my-deja.com>
Subject: Re: accessing global variables in another perl module
Message-Id: <8r0d97$pej$1@nnrp1.deja.com>

thanks for your info ren, this actually explains what happening too.

pity about some of the voodoo magic one has to do with the header-file
method. not intuitive at all, but good to know how to do it.

cheers,
j.


In article <m3bsx99poq.fsf@dhcp11-177.support.tivoli.com>,
  Ren Maddox <ren.maddox@tivoli.com> wrote:
> jason iversen <jasoniversen@my-deja.com> writes:
>
> > hi there,
> >
> > i am having trouble with accessing a global variable defined in
main()
> > in a second perl module.
> >
> > i need the following...
> >
> >   A.pl creates and sets global variable $D, then calls a sub in B.pm
> >   B.pm accesses $D (perhaps modifying it)
> >
> >
> > how do i do it? i cant figure it out. i have tried "use vars qw($D)"
in
> > B.pm, but that doesnt work. i have tried using Exporter and have had
no
> > luck.
>
> First of all, Perl doesn't *really* have global variables.  It has
> package variables (and lexical variables, which may also be
> important).  If A.pl has no package statement, then it defaults to
> package "Main".  Presumably B.pm has a "package B;" statement.  To
> access a variable in a different package, simply prefix it with the
> package name and "::".  For example, if $D is a package variable in
> package "Main", accessing it from another package is done via
> $Main::D or even simply $::D.
>
> This all assumes that $D is a package variable and not a lexical
> variable.  Lexical variables are only available outside of their scope
> via references.  So if you are doing "my $D;" within A.pl, then B.pm
> will not normally be able to access this variable.  If you are doing
> "our $D;" then you're OK.
>
> For more and better information, see "perldoc perlsub".
>
> --
> Ren Maddox
> ren@tivoli.com
>

--
jason iversen
technical director
digital domain


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


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

Date: 28 Sep 2000 20:46:48 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: An interesting situtation!!! Please help me!!!
Message-Id: <970174007.652831@hpvablab.cup.hp.com>

hsriniv@my-deja.com writes:
>Hi everybody,
>I have got an interesting situation. Please help me.
>
>The situation is:
>
>I have got a file which looks like this:

[Ok, it looks like several blocks of text each ending with a ; and two
newlines.  Each block contains a comma delimited list of things, and
some of the things look like .ABCDE(XYZ), with spaces here and there.]

>ADDACC1 P45 ( .ACCRN( RNBUF), .CK125( CK125), .CKBLKG( CKBLKG), .FULLACC
>( FULLACC), .LSDI( DI_0), .LSDO( DO_0), .LSP( P_0), .MSDI( DI_1), .MSDO
>( DO_1), .MSP( P_1
>), .OVERSAMP( OVERSAMP), .PRESCOUT
>( PRESCOUT) );
>
>RCNT8 P43 ( .CK( MXRCB_7), .Q_0( RC_8), .Q_1( RC_9), .Q_2( RC_10), .Q_3
>( RC_11), .Q_4( RC_12), .Q_5( RC_13), .Q_6( RC_14), .Q_7( RC_15), .QB_7
>( RCB_15
>), .RN
>( RNBUF) );
>

[...]

>
>endmodule
>
>I will have to get unique occurances of the things in the parantheses
>after the ".", FOR EG:

Use a regular expression to extract the text within the parentheses and
then use a perl hash to store each occurrence.  You'll want to look
closely at multiline matching (i.e., so it treats newlines as spaces),
and if the file is small enough, load the entire file into a scalar and
match on the entire file at once.

If the file is too big, read each record and apply a regular expression
to it.  If you look in the perlvar man page, it has a variable that
helps you read in records instead of lines -- $/.

>.......... and I will have to continue doing this till i see
>the "endmodule"....

Read the file until you reach that string.

>But i will print only the unique occurance. FOR EG:
>you can see that the RNBUF, occurs twice but it should be printed only
>once.
>
>PLEASE HELP ME.
>
>ANY KIND OF HELP IS APPRECIATED.

Show us what you have so far and we can help you within the framework
you've already started.

>THANKS IN ADVANCE.
>
>Hari.
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Thu, 28 Sep 2000 14:41:41 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: An interesting situtation!!! Please help me!!!
Message-Id: <MPG.143d5aeba3d0c8e198add7@nntp.hpl.hp.com>

[Your Subject doesn't describe the problem; it describes how you feel 
about the problem.]

In article <8qqnu0$5re$1@nnrp1.deja.com> on Tue, 26 Sep 2000 17:55:17 
GMT, hsriniv@my-deja.com <hsriniv@my-deja.com> says...

 ...

> I have got a file which looks like this:

<SNIP too-long example file; see the post being responded too>

> I will have to get unique occurances of the things in the parantheses
> after the ".", FOR EG:

 ...

perlfaq4: "How can I remove duplicate elements from a list or array?"


#!/usr/bin/perl -w
use strict;

my @list;

{
   local $/ = ""; # Set paragraph mode.
   my %seen;
   push @list, grep !$seen{$_}++ => /\.\w+\(\s*(\w+)/g while <DATA>;
}

@list = sort @list; # If you wish, to verify no duplicates.

print "@list\n";
__END__

If you don't mind reading the entire file at once, that can be slightly 
shortened to:

   @list = grep !$seen{$_}++ => map /\.\w+\(\s*(\w+)/g => <DATA>;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 28 Sep 2000 13:41:53 -0400
From: Gopi Sundaram <gopalan@cs.sc.edu>
Subject: Better way to split
Message-Id: <Pine.OSF.4.21.0009281336020.15163-100000@pearl.cs.sc.edu>

Hello all,

I am parsing a file that has 8 colon separated fields on each line. I
am only interested in the first two fields. I can think of these
possibilities. No doubt there are others.

($field1, $field2) = split /:/;

($field1, $field2, $junk) = split /:/, $_, 3;

($field1, $field2, @junk) = split /:/;

So which is the preferred way of splitting ?

Gopi.

-- 
Gopi Sundaram
gopi@cs.sc.edu



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

Date: Thu, 28 Sep 2000 14:45:42 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Better way to split
Message-Id: <Pine.GSO.4.21.0009281445170.5957-100000@crusoe.crusoe.net>

[posted & mailed]

On Sep 28, Gopi Sundaram said:

>($field1, $field2) = split /:/;
>($field1, $field2, $junk) = split /:/, $_, 3;
>($field1, $field2, @junk) = split /:/;

Junk variables should be avoided at all costs.  Method 1 is preferred.

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/





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

Date: Thu, 28 Sep 2000 19:41:18 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Better way to split
Message-Id: <y9NA5.181$UA3.9765@eagle.america.net>

On Thu, 28 Sep 2000 13:41:53 -0400, Gopi Sundaram <gopalan@cs.sc.edu> wrote:
>Hello all,
>
>I am parsing a file that has 8 colon separated fields on each line. I
>am only interested in the first two fields. I can think of these
>possibilities. No doubt there are others.
>
>($field1, $field2) = split /:/;
>
>($field1, $field2, $junk) = split /:/, $_, 3;
>
>($field1, $field2, @junk) = split /:/;
>
>So which is the preferred way of splitting ?

The doc implies that the first possibility is the fastest choice (it's
the cleanest looking): 

$ perldoc -f split
    split /PATTERN/,EXPR,LIMIT
 ...
    When assigning to a list, if LIMIT is omitted, Perl supplies a
    LIMIT one larger than the number of variables in the list, to
    avoid unnecessary work.                                    ^^
    ^^^^^^^^^^^^^^^^^^^^^^^

The other choices require extra work with the third being the worst.  

-- 
Garry Williams


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

Date: 28 Sep 2000 20:04:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <8r087l$ikp$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to 
<mexicanmeatballs@my-deja.com>],
who wrote in article <8qv5dg$n2g$1@nnrp1.deja.com>:
> > >Should not a ? b : c become
> > >
> > >    a :-) b :-( c
> > >
> > >?

> Until it appears deeply nested in a bracketed expression where
> a,b and c are also bracketed expressions and then it becomes
> deeply confusing.

Why?  You should be able to rewrite it as

  a :-( c :-) b

Parens will properly match.

Ilya


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

Date: 28 Sep 2000 20:05:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <8r08ab$im1$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Bart Lateur 
<bart.lateur@skynet.be>],
who wrote in article <sts5tsgutoj7hv26hhhe6saiqofnv2ui3t@4ax.com>:
> >It seems that splice() should be an l-value.
> 
> Heh, you're right. It seems like
> 
> 	@a = qw(a b c d);
> 	splice @a, 1, 2 = (1 .. 4);
> 
> should work

Nope.  Wrong precedence.  And parens will make this ugly anyway.

Ilya


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

Date: Thu, 28 Sep 2000 21:51:19 GMT
From: "Nebulus" <news@nebulus.org>
Subject: connecting to Verisign's PayFlo Pro - anybody?
Message-Id: <r3PA5.130$mB3.6772@newsread2.prod.itd.earthlink.net>

Has anyone has success connecting scripts to Verisign's PayFlo Pro package?
I've got a client who was using a shopping cart that connected to PayFlo
Pro, but that cart was pretty bad. I'm trying to write some CGI that will
conenct to the PayFlo site, but I have no idea how to use the PayFlo SDKs,
or where they might be installed on the host system. Any help in this would
be greatly appreciated. Thanks!




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

Date: Thu, 28 Sep 2000 18:37:09 GMT
From: frescot@my-deja.com
Subject: dbi modules
Message-Id: <8r034l$frj$1@nnrp1.deja.com>

Do dbi modules need to be recomplied when
installed on win 2K... having trouble tring to
connect to an Oracle DB with this code:#!
usr/bin/perl -w

#test connection to DB on epubsdev

use DBI; #module please be there
use DBD::Oracle;

my $serviceName = "main";
chomp($serviceName);

my $dbConnection = DBI->
connect "dbi:Oracle:$serviceName", "scott", "tiger
" )
   or die "Cannont open $serviceName:
$DBI::errstr\n";

exit;

ps: the db is located elsewhere in the building
and is running on sun



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


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

Date: Thu, 28 Sep 2000 12:01:59 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: dbi modules
Message-Id: <39D395A7.161A2649@vpservices.com>

frescot@my-deja.com wrote:
> 
> Do dbi modules need to be recomplied when
> installed on win 2K

Yes, but that has already been done by activeState.  Use ppm to install
DBI and the DBDs.

>... having trouble tring to
> connect to an Oracle DB with this code:

"Trouble" is rather unspecific.  You need to tell us the error message
you see.

> use DBD::Oracle;

That line is not needed.  Juse "use DBI" and the DBD will be called when
you make the connection.

> ps: the db is located elsewhere in the building
> and is running on sun

In other words, it is a remote resource (i.e. not on the same machine as
your script).  Did you follow the instructions in the DBI and
DBD::Oracle docs for connecting to a remote resource?

-- 
Jeff


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

Date: Thu, 28 Sep 2000 13:55:04 -0400
From: Drew Simonis <dsimonis@fiderus.com>
Subject: Re: enter-key in forms
Message-Id: <39D385F8.2768CCF4@fiderus.com>

Philipp Schill wrote:
> 
> hi everybody,
> 
> does anyone know how the enter-key is linked with forms? I know pages where
> i can press enter and the form will be submitted, on other pages it doesn't
> work. how can i activate this function ?
> 
> waiting for reply... ;-)
> 
> phil.

Nothing to do with Perl, this is browser behaviour.


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

Date: Thu, 28 Sep 2000 20:31:55 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: enter-key in forms
Message-Id: <Pine.GHP.4.21.0009282016220.19559-100000@hpplus03.cern.ch>

On Thu, 28 Sep 2000, Philipp Schill wrote:

> does anyone know how the enter-key is linked with forms? 

By the browser designer - if, as I assume, this is meant to be a WWW
question.

If you think this has anything to do with the choice of programming
language in which you write your CGI script, then I'd have to counsel
you to review how the WWW works, or else (quite apart from the dusty
answers that you're due to get from this group), you're going to make
your problems far more complicated than they need be.

Your browser gets an HTML document sent across the WWW (with, perhaps,
the additional complication of some javascript in it). The browser
does not need to know or care how you generated that document, nor
does it need to know or care what you plan to do with it when it has
been submitted.  All it needs to pay attention to are the HTML,
javascript etc. that are contained in the document, and (in relevant
contexts, but this isn't one of them), also the HTTP headers that
accompanied the document.  And there the direct relevance ends.

You will find that problem solving becomes much easier and clearer if
you can build a mental picture of how the various components work
together, because then you could know which of the components could be
directly relevant to your question and which could not be, and so
you could focus-in on the problem more quickly and effectively, and
know where best to ask the question when a question has to be asked.

> I know pages where
> i can press enter and the form will be submitted, on other pages it doesn't
> work. 

That's true, but it also depends on your choice of browser (and what
that browser implementer decided to do).

> how can i activate this function ?

By first reading a popular HTML FAQ entry:

   http://www.htmlhelp.org/faq/html/forms.html#enter-submit

FAQs are good for you.  Take one frequently, and not only when
the symptoms recur.

good luck



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

Date: 27 Sep 2000 22:05:49 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: freeware perl script to binary...
Message-Id: <8qtnfd$6pm$1@orpheus.gellyfish.com>

On Tue, 26 Sep 2000 10:24:19 +0100 Paul Spandler wrote:
> Abigail wrote:
>> 
>> Paul Spandler (p.m.spandler@bton.ac.uk) wrote
>> == I'm looking for a freeware unix perl to executable file converter.
>> 
>> chmod, which can be found at: <ftp://ftp.gnu.org/gnu/fileutils/>, and
>> runs on more Unices than you can think of.
> 
> Oops, sorry...maybe I should have explained myself better!
> 
> I want to convert perl scripts into binaries (basically to hide the
> script source in a chrooted environment.)
> 

No thats fine.  We understood perfectly well.  If you need to hide the script
source you are doomed anyway.  Fix the inherent security problem.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Thu, 28 Sep 2000 21:30:05 -0000
From: chalesx <chalesx@yahoo.com>
Subject: function reference
Message-Id: <st7e2ti40qn57b@corp.supernews.com>

Hi,

Do anyone know how to pass a function like 'sort'?

Currently, I can only pass a function using reference:
foo_caller(\&foo)

or

pass the string value of the function and use 'eval' the run the function.

I would like to create something similar to 'sort' where you
can pass the function 'naked'. (e.g.  sort numerically (5, 6, 1, ...))

Thanks in advance.

--
Posted via CNET Help.com
http://www.help.com/


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

Date: Thu, 28 Sep 2000 20:13:24 GMT
From: nlymbo@my-deja.com
Subject: global variable
Message-Id: <8r08os$l3p$1@nnrp1.deja.com>

Hi

I have a global variable in my main package. I also "require" a library
and i would like that variable to be available to the required package.
How can i do this??

eg.

main:

$GLOBALVAR = "something";

require "alib.pl"

 ...

I want alib.pl to have access to $GLOBALVAR. Is this possible??


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


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

Date: Thu, 28 Sep 2000 20:12:13 GMT
From: Francis Litterio <franl-removethis@world.omitthis.std.com>
Subject: How to do a UDP broadcast using IO::Socket?
Message-Id: <m3wvfw6ztu.fsf@franl.andover.net>

Using Perl 5.005_03, there seems to be a chicken-and-egg problem when
doing a UDP broadcast with module IO::Socket:

    #!/usr/bin/perl -w
    use strict;
    use IO::Socket;

    # Do a subnet-directed UDP broadcast.
    my $sock = IO::Socket::INET->new(PeerAddr => '209.192.217.255',
				     PeerPort => 9999,
				     Proto => 'udp',
				     Type => SOCK_DGRAM,
				     Reuse => 1);
    die "IO::Socket::INET->new: $!\n" unless $sock;

    $sock->sockopt(SO_BROADCAST, 1) or die("sockopt: $!\n");
    $sock->autoflush();

    while (<>)
    {
	print $sock $_;
    }

    close $sock;

The above script produces this output:

    IO::Socket::INET: Permission denied at ./foo line 6
    IO::Socket::INET->new: Bad file descriptor

The "Permission denied" error appears to be the same one described by
Stevens on page 475 of "UNIX Network Programming, Vol. 1" (2nd Edition).
The call to new() fails because the SO_BROADCAST option is not set on the
socket, but until new() gives me an IO::Socket object, I can't call
sockopt() to set that option.

I think the "Permission denied" error happens at the moment that new()
attempts to connect the UDP socket.  If there was a way to call new() so
as not to connect the socket, then that might help, but I can't see a way
to do that from the IO::Socket documentation.

I _can_ make it work using the older Socket module, but I would prefer to
do this using IO::Socket.  Any ideas?
--
Francis Litterio
franl-removethis@world.std.omit-this.com
PGP public keys available on keyservers.


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

Date: Thu, 28 Sep 2000 12:31:56 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: How to get length of scalar?
Message-Id: <39d39c61$1@news.microsoft.com>

"Mark Carruth" <mcarruth@talk21.com> wrote in message
news:8qthfc$26d$1@uranium.btinternet.com...
> Why is it you people have such a problem with HTML. Either, get a decent
> mail client for Windows, or if you use Unix and you are such a bloody
genius
> at it to go criticising other people, make yourself a f*c*i*g HTML parser
> that will work on Windows.

Did it ever occur to you that Usenet is plain-text only?
Or would you drive with a car on a (pedestrian-only) sidewalk, too (just
because it's convenient for you)?

You can very well expect to be yelled at in both cases.

jue




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

Date: Thu, 28 Sep 2000 19:39:06 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: How to get length of scalar?
Message-Id: <u7NA5.1402$Yc.238650@news.uswest.net>

"Mark Carruth" <mcarruth@talk21.com> elucidates:
> As a large proportion of the Internet is centered around HTML, I think it is
> a good idea that whatever programme anyone writes to talk to an NNTP server
> has some form of HTML parser built in.

As a good portion of the American highway system is built from concrete,
I think it a good idea that everyone drive a cement truck.

> but as you people don't seem to care about what I have to say, 

I am pleased you figured that out.  What took you so long?

> I shan't bother helping people any more.

Well there is a God, after all...

Let me help you one last time...

*plonk*


-- 
"Civilization rests on two things: the discovery that fermentation 
produces alcohol, and the voluntary ability to inhibit defecation.  
And I put it to you, where would this splendid civilization be without 
both?" --Robertson Davies "The Rebel Angels" 


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

Date: 28 Sep 2000 20:27:48 GMT
From: add@netcom.com (Arthur Darren Dunham)
Subject: Re: How to get length of scalar?
Message-Id: <8r09k4$osg$1@slb3.atl.mindspring.net>

In article <8qvur2$4il$1@uranium.btinternet.com>,
Mark Carruth <mcarruth@talk21.com> wrote:
>The reason I post HTML is that I use Outlook Express to look at these
>newsgroups, and I also use Outlook Express to read my mail.

Does that program not have a setting for posting in plain text?  I know
most do.

>As I send all my emails (which are part of my LIFE Uri) using HTML, the
>programme sends all my posts in HTML. I never have people moaning about HTML
>in Email so I don't know why I should change.

No one can force you to.

The question is what kind of response you want to generate. 

--
Darren Dunham                                           ddunham@taos.com
Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                               San Francisco Bay Area
      < Please move on, ...nothing to see here,  please disperse >


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

Date: Thu, 28 Sep 2000 20:46:22 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: How to get length of scalar?
Message-Id: <x7lmwc6y90.fsf@home.sysarch.com>

>>>>> "MC" == Mark Carruth <mcarruth@talk21.com> writes:

  MC> As a large proportion of the Internet is centered around HTML, I
  MC> think it is a good idea that whatever programme anyone writes to
  MC> talk to an NNTP server has some form of HTML parser built in.

you are on crack. NNTP and HTML have nothing to do with each other. the
fact that some clients choose to support it does not make i acceptable
to all. i choose to use call you an idiot. does that force your wife to
call you one too? i sure hope so!

  MC> And, yes URI, my message DID contain some information but as you
  MC> people don't seem to care about what I have to say, I shan't
  MC> bother helping people any more.

tehn try and go back and post that tidbit. i recall scanning it and
found nothing but html and some trifle quoted text. nothing of any
content. but i can expect that from you.

as for helping here, moronzilla has provided more help. now, THAT is an
insult.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 28 Sep 2000 21:16:03 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How to get length of scalar?
Message-Id: <st7d8j7l0f92b7@corp.supernews.com>

Uri Guttman (uri@sysarch.com) wrote:
:   MC> As a large proportion of the Internet is centered around HTML, I
:   MC> think it is a good idea that whatever programme anyone writes to
:   MC> talk to an NNTP server has some form of HTML parser built in.
: 
: you are on crack. NNTP and HTML have nothing to do with each other. the
: fact that some clients choose to support it does not make i acceptable
: to all. i choose to use call you an idiot. does that force your wife to
: call you one too? i sure hope so!

To move to a deeper version of the highway analogy posted earlier, "Most
vehicles on the highways are cars.  Therefore, I will ship these
refrigerators in cars."  The same transport medium (the highway system,
the internet) can be used for radically different purposes (the web vs.
usenet, passenger transportation vs. goods shipping), and each such use
may demand different standards and practices (http vs. nntp and html vs.
plain text, cars vs. trucks).

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


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

Date: Thu, 28 Sep 2000 21:22:48 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: How to get length of scalar?
Message-Id: <IEOA5.5$pD5.2071@news1.rdc1.mb.home.com>

In article <8qvur2$4il$1@uranium.btinternet.com>,
 Mark Carruth <mcarruth@talk21.com> wrote:

! The reason I post HTML is that I use Outlook Express to look at these
! newsgroups, and I also use Outlook Express to read my mail.

Since you have demonstrated your ability to post in plain text, you
cannot then blame your client software for HTML posts -- continuing
to post HTML can only be interpreted as laziness and disrespect on
your part.

! As I send all my emails (which are part of my LIFE Uri) using HTML,
! the programme sends all my posts in HTML. I never have people moaning
! about HTML in Email so I don't know why I should change.

No one ever complains when I drive on the right side of the road
here, so when I visit another community (say, in England) why should
I change?

Please stop with your feeble excuses -- take some responsibility for
your actions. If you did you wouldn't now find yourself in so many
killfiles.

*plonk*

andrew

-- 
Andrew L. Johnson   http://members.home.net/perl-epwp/
      In theory, there's no difference between
      theory and practice, but in practice there is!


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

Date: Thu, 28 Sep 2000 21:47:52 GMT
From: mikewise99@my-deja.com
Subject: Re: How to monitor end of text file
Message-Id: <8r0ea5$q54$1@nnrp1.deja.com>

Found a good solution in the Perl Cookbook (thanks Tom and/or Nathan).

   #!/usr/bin/perl
   use IO::Seekable;

   my $fname = "httpd.access_log";
   open (FH,$fname) || die ("could not open $fname for reading\n");
   seek( FH, 0, 2 ); # skip to eof
   for (;;) {
      while(my $l = <FH>){ print $l;   }
      sleep 1;
      FH->clearerr(); # clear the error and do it again
   }

In article <8qvhrh$gm$1@nnrp1.deja.com>,
  mikewise99@my-deja.com wrote:
> Hi,
>
> I want a perl demon to watch a big log file and react when certain
> messages appear there. Efficiently.
>
> Obviously I could just watch for the date to change, then read to the
> end of the file, but this is a big log file, and that is an ugly
> solution.
>
> If it were C, I could seek to the end and go back to the newline,
> but I wonder if there isn't a niftier way to do it in perl.
>
> Please enlighten me...
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


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


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

Date: Thu, 28 Sep 2000 18:16:35 GMT
From: joshfeingold@my-deja.com
Subject: HTML Email
Message-Id: <8r01tp$eoa$1@nnrp1.deja.com>

I am trying to send HTML email from a perl script, but when it is sent
the HTML formatting is not used (rather the mark-up is in plain view).

I imagine that I am doing the MIME header incorrectly but am not sure
how.  I have looked around the discussion boards but have not found
anyone addressing the exact text that should be printed at the header
for it to be read as HTML by the email application (in my case Outlook).

If you can assist, it would be appreciated.

Josh



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


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

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


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