[15619] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3032 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 12 18:15:49 2000

Date: Fri, 12 May 2000 15:15:24 -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: <958169724-v9-i3032@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 12 May 2000     Volume: 9 Number: 3032

Today's topics:
    Re: Problem: hash introducing extra space on output? (Abigail)
    Re: Problem: hash introducing extra space on output? <lr@hpl.hp.com>
    Re: Q: Benchmarking hash pre-size (Ilya Zakharevich)
    Re: Randomised function <news@webneeds.com>
    Re: Regular expression ? <aqumsieh@hyperchip.com>
    Re: Regular expression ? (Abigail)
    Re: Regular expression ? <andrew.mcguire@walgreens.com>
    Re: Regular expression ? <lr@hpl.hp.com>
    Re: Regular expression ? <jeff@vpservices.com>
    Re: Regular expression ? <andrew.mcguire@walgreens.com>
    Re: Regular expression ? <andrew.mcguire@walgreens.com>
    Re: Regular expression ? <godzilla@stomp.stomp.tokyo>
    Re: Regular expression ? (Abigail)
    Re: Regular expression ? <andrew.mcguire@walgreens.com>
    Re: remaining disk space <ozette.brown@infotechfl.com>
    Re: Running perl code thru crontab <rootbeer@redcat.com>
    Re: Running perl code thru crontab <zigouras@mail.med.upenn.edu>
        semctl GETALL <jfw@saltmine.radix.net>
    Re: sendmail on WinNT <lauren_smith13@hotmail.com>
    Re: sendmail on WinNT <Allan@due.net>
        Silencing module warnings. <andrew.mcguire@walgreens.com>
    Re: The way to load a script on certain time by itself  (Abigail)
    Re: unresolved external in XSUB <Jonathan.L.Ericson@jpl.nasa.gov>
    Re: Where's the FAQ? <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 12 May 2000 19:05:33 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Problem: hash introducing extra space on output?
Message-Id: <slrn8holfs.bgd.abigail@ucan.foad.org>

On Fri, 12 May 2000 09:03:21 GMT, Bill <wfeidt@cpcug.org> wrote:
++ 
++ %filename =  ("employer.html",    "@employer",
++               "position.html",    "@position",
++               "new.html",         "@new");
++ 
++ 
++ foreach (keys %filename)  {
++      print OUTFIL "$filename{$_}";
++ }
++ 
++ 
++ The problem is that the output from the 'print OUTFIL "$filename{$_}";'
++ statement looks like this:
++ 
++ 
++ <li><a href="j20000412f05.html">...
++  <li><a href="j20000412f03.html">...
++  <li><a href="j20000414f01.html">...
++  <li><a href="j20000501f01.html">...
++ 
++ rather than the desired:
++ 
++ <li><a href="j20000412f05.html">...
++ <li><a href="j20000412f03.html">...
++ <li><a href="j20000414f01.html">...
++ <li><a href="j20000501f01.html">...
++ 
++ 
++ I've checked the source arrays (e.g. @employer, @position, etc.)  and there
++ is no "extra space" present in the them.

Well, yes, the source arrays don't, but that's not what you are printing,
now is it? You are printing a string, which you got by "@employer",
"@position", etc. You might want to check your documentation about
interpolating, and then study 'man perlvar'; or use a different (less
memory unfriendly) way of storing the information.



Abigail


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

Date: Fri, 12 May 2000 11:59:51 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Problem: hash introducing extra space on output?
Message-Id: <MPG.1385f482304b985098aa64@nntp.hpl.hp.com>

In article <8F3280EE9wfeidthiscom@207.126.101.97> on Fri, 12 May 2000 
17:00:40 GMT, Bill <wfeidt@cpcug.org> says...

 ...

>   [...]
>   $"="";

If you do it this way:

    { local $" = "";

Then you don't have to know what to restore it to below.  But if you 
don't stringify the arrays, you don't need this at all.  See below.

>   %filename =  ("employer.html",    "@employer",
>                 "position.html",    "@position",
>                 "animals.html",     "@animals",
 ...
>                 "new.html",         "@new");
>   $"=" ";
> 
>   foreach (keys %filename)  {
>   [...]
> 
> Is there a reason not to do it this way?

You seem to be going out of your way to stringify each of those arrays, 
which seems like a lot of extra work.  Why not use references instead?

    %filename =  ("employer.html",    \@employer,
                  "position.html",    \@position,
                  "animals.html",     \@animals,

Now, whenevr I see so much duplication of effort (in this case, the 
names of files and the names of arrays and the names of flags and the 
names of keywords in the input data), I look for how to eliminate it, 
because it is tedious to generate and hard to maintain.  In this case, I 
would make each of those arrays into anonymous array references, and 
derive everything from the keys of the hash.

Here are excerpts from the original code in the URL of your original 
post, with my suggestions for a more appropriate data structure.  The 
basic principle is to replace regularities in the program structure with 
regularities in the data structure.

http://www.agnic.org/temp/umdext/dcprj/c/test1.txt

 ...   
     while (<INFIL>)  {       #Operations on each line
          chomp;
 ...
          if (/--Animals--/)                    { $animals     = 1 }
          if (/--Business--/)                   { $business    = 1 }
          if (/--Environment--/)                { $environment = 1 }
 ...
     }
 ...
     if ($animals)      { push @animals,     $style2 }
     if ($business)     { push @business,    $style2 }
     if ($environment)  { push @environment, $style2 }
 ...
}
 ...
@animals     = sort SORT_ITEM_LIST @animals;
@business    = sort SORT_ITEM_LIST @business;
@environment = sort SORT_ITEM_LIST @environment;
 ...
%filename =  (
 ...
              "animals.html",     "@animals",
              "business.html",    "@business",
              "environment.html", "@environment",
 ...
foreach (keys %filename)  {
     open OUTFIL, ">$_" or die "Cannot open $_ for write: $!";
     print $_;
     chmod 0644, $_;
 ...
     elsif ($_ eq "animals.html")
                { $title = "Animal Related Positions" }
     elsif ($_ eq "business.html")
                { $title = "Business Related Positions" }
     elsif ($_ eq "environment.html")
                { $title = "Environment Related Positions" }
 ...
     print OUTFIL "$filename{$_}";
 ...
}
__END__ of original code

My approach (anonymous array[reference]s in a hash):

     my %names;

     while (<INFIL>)  {       #Operations on each line
          chomp;
 ...
          /--([A-Z][a-z]+)--/ and $key = lc $1;
 ...
     }
 ...
     push @{$names{$key}}, $style2;
 ...
}
 ...
foreach (keys %names)  {
     open OUTFIL, ">$_.html" or die "Cannot open $_.html for write: $!";
     print "$_.html";
     chmod 0644, "$_.html";
 ...
     $title = "\u$_ Related Positions";
 ...
     print OUTFIL sort SORT_ITEM_LIST @{$names{$key}};

 ...
}
__END__ of replacement code

Note how all of your long lists of preassigned names and tests and loops 
are gone, replaced by data-driven activities.

No doubt your real program will have some deviations from this degree of 
regularity.  But the general approach is invaluable.

I'll repeat the 'bottom line' for anyone who has read this far:

Build the regularity into the data structure, not into the program!

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


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

Date: 12 May 2000 18:13:34 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Q: Benchmarking hash pre-size
Message-Id: <8fhhke$7a9$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Phoenix 
<rootbeer@redcat.com>],
who wrote in article <Pine.GSO.4.10.10005121056440.16364-100000@user2.teleport.com>:
> >     undef my %hash;
> 
> That's unusual and the undef is superfluous

Do not think so.

perl -MDevel::Peek -wle 'sub a { my @a; Dump \@a; @a=(1..20)}; a; a;'
SV = RV(0x11f010) at 0xedb64
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0xed9a8
    SV = PVAV(0xea710) at 0xed9a8
      REFCNT = 2
      FLAGS = (PADBUSY,PADMY)
      IV = 0
      NV = 0
      ARRAY = 0x0
      FILL = -1
      MAX = -1
      ARYLEN = 0x0
      FLAGS = (REAL)
SV = RV(0x11f010) at 0xedb64
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0xed9a8
    SV = PVAV(0xea710) at 0xed9a8
      REFCNT = 2
      FLAGS = (PADBUSY,PADMY)
      IV = 0
      NV = 0
      ARRAY = 0xe2d30
      FILL = -1
      MAX = 19
      ARYLEN = 0x0
      FLAGS = (REAL)

Note MAX being 19.

perl -MDevel::Peek -wle 'sub a { undef my @a; Dump \@a; @a=(1..20)}; a; a;'
SV = RV(0x11f010) at 0xedb64
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0xed9a8
    SV = PVAV(0xea6e0) at 0xed9a8
      REFCNT = 2
      FLAGS = (PADBUSY,PADMY)
      IV = 0
      NV = 0
      ARRAY = 0x0
      FILL = -1
      MAX = -1
      ARYLEN = 0x0
      FLAGS = (REAL)
SV = RV(0x11f010) at 0xedb64
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0xed9a8
    SV = PVAV(0xea6e0) at 0xed9a8
      REFCNT = 2
      FLAGS = (PADBUSY,PADMY)
      IV = 0
      NV = 0
      ARRAY = 0x0
      FILL = -1
      MAX = -1
      ARYLEN = 0x0
      FLAGS = (REAL)

> Well, I can't see the flaw in your methods. Although I've tried several
> variants in your code, I can't make an example which shows a significant
> time savings for presizing. Either there's a flaw in our methods, or
> presizing just isn't a big deal. 

Presizing is supposed to save mosly memory, not speed.  Though there
are some tricks in perl which may decrease memory usage even without
presizing.

Ilya


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

Date: Fri, 12 May 2000 12:05:24 -0600
From: "Dan Manion" <news@webneeds.com>
Subject: Re: Randomised function
Message-Id: <4OXS4.108$oo3.4076@news.uswest.net>

There is a nice little perl module for this called String::Random.  You can
pick up a copy at CPAN.

example of how it's used ...
use String::Random;
my $gen = new String::Random;
my $pass = $gen->randpattern("cnCCnCcc");

but you'll want to look at its perldoc to find out the best usage in your
situation.

Hope this helps,

Dan

"Mike Moose" <mike_moose@yahoo.com> wrote in message
news:391C12CE.1161572A@yahoo.com...
> Hi, I'm trying to write a perl function which will generate a random
> password of 8 character, numbers/characters ... in C there is rand()
> which generates a random number synched with the time, is there a
> function similar to this in Perl...
>
> Thanks
>




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

Date: Fri, 12 May 2000 18:31:26 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Regular expression ?
Message-Id: <7awvkz7h8g.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>


perl_phreak@yahoo.com (Gordon Clemmons) writes:

> Perlgolf anyone?
> 
> print + (split /\s+/, $_)[4] . "\n" while (<DATA>);

If you insist:

	print+(split)[3],"\n"while<DATA>;

	map{print+(split)[3],"\n"}<DATA>;

	print+(/\S+/g)[3],"\n"for<DATA>;

	print+(split)[3],"\n"for<DATA>;


--Ala


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

Date: 12 May 2000 18:41:38 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Regular expression ?
Message-Id: <slrn8hok31.bgd.abigail@ucan.foad.org>

On Thu, 11 May 2000 21:07:23 GMT, Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
++ 
++ tvn007@my-deja.com writes:
++ 
++ >  Hi,
++ > 
++ > Could someone please help me with the following pattern matching ?
++ > 
++ > Here is the data:
++ > 
++ > 305   : 0_0  2.01  A
++ > 306   : 0_0  1.80  AR
++ > 305   : 0_0  2.50  AR
++ > 
++ > 
++ > I would like to extract number 2.01, 1.80 and 2.50
++ > 
++ > Here is what I have, and it does not work (i.e does not print out
++ > anything)
++ > 
++ > if($_ =~ /^[0-9]\s*:\s*0_0\s*([0-9])\s*[A-R]/)
++ > 
++ > 	print "$_\n";
++ > 	print  "$1\n";
++ 
++ First of all, the above won't compile because of the missing braces for
++ the if() block. Please post legitimate code next time if you want your
++ problem to be accurately diagnosed.
++ 
++ Second of all, others have told you that split() is a better choice
++ here, but it really depends on your input data. If you can guarantee
++ that there will always be spaces in the places shown in your test case,
++ then a simple split() should do:
++ 
++ 	my $number = (split)[3];


Well, if the data is as regular as the example suggests, no regex or split
is needed. 

        my $number = substr ($_ => 13, 4);

would do.


Abigail


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

Date: Fri, 12 May 2000 14:12:10 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: Regular expression ?
Message-Id: <391C578A.14B49462@walgreens.com>

Ala Qumsieh wrote:
> 
> perl_phreak@yahoo.com (Gordon Clemmons) writes:
> 
> > Perlgolf anyone?
> >
> > print + (split /\s+/, $_)[4] . "\n" while (<DATA>);
> 
> If you insist:
> 
>         print+(split)[3],"\n"while<DATA>;
> 
>         map{print+(split)[3],"\n"}<DATA>;
> 
>         print+(/\S+/g)[3],"\n"for<DATA>;
> 
>         print+(split)[3],"\n"for<DATA>;

Yet another way, not quite as short.

print [split]->[3], "\n" for <DATA>;

From the command line:

perl -ape '$_=$F[3]."\n"' file

seems to be the shortest.

Cheers,

anm
-- 
Andrew N. McGuire
andrew.mcguire@walgreens.com


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

Date: Fri, 12 May 2000 12:17:32 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Regular expression ?
Message-Id: <MPG.1385f8a243be357998aa66@nntp.hpl.hp.com>

In article <8F326C1B7nospamblahcom@206.165.3.80> on 12 May 2000 17:41:03 
GMT, Gordon Clemmons <perl_phreak@yahoo.com> says...
> >tvn007@my-deja wrote:

 ...

> Perlgolf anyone?
> 
> print + (split /\s+/, $_)[4] . "\n" while (<DATA>);
> 
> 
> __DATA__
>         abc   : 0_0  2.02  A
> 	305   : 0_0  2.01  A
> 	306   : 0_0  1.80  AR
>  	305   : 0_0  2.50  AR
> 
> I can't wait to see the gurus post a 3 character reply and smoke me:)

Not quite.

  print +(split)[3], "\n" while <DATA>;

All the spaces are superfluous, and would be stripped for real Perl 
Golf.  And I would use 'for' instead of 'while', because it is two 
strokes shorter and damn the memory load.  Or:

  print map+(split)[3]."\n",<DATA>;

Or, as a command-liner:

  perl -ple"(split)[3]" file...

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


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

Date: Fri, 12 May 2000 12:39:57 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Regular expression ?
Message-Id: <391C5E0D.D553AF49@vpservices.com>

Larry Rosler wrote:
> 
>      '¦' ne '|'

Thanks, Tad also tipped me to that via email.   It's ok, to quote myself
from the same post in which I made that error:  "Ha ha, what an idiot
Jeff is." 

-- 
Jeff


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

Date: Fri, 12 May 2000 14:50:25 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: Regular expression ?
Message-Id: <391C6081.8CB18A8F@walgreens.com>

Larry Rosler wrote:
> 
> In article <8F326C1B7nospamblahcom@206.165.3.80> on 12 May 2000 17:41:03
> GMT, Gordon Clemmons <perl_phreak@yahoo.com> says...
> > >tvn007@my-deja wrote:
> 
> ...
> 
> > Perlgolf anyone?
> >
> > print + (split /\s+/, $_)[4] . "\n" while (<DATA>);
> >
> >
> > __DATA__
> >         abc   : 0_0  2.02  A
> >       305   : 0_0  2.01  A
> >       306   : 0_0  1.80  AR
> >       305   : 0_0  2.50  AR

[ snip ]
 
>   print map+(split)[3]."\n",<DATA>;
> 
> Or, as a command-liner:
> 
>   perl -ple"(split)[3]" file...

This one liner does not work, because the '-p' only prints '$_'.

Cheers,

Andrew

-- 
Andrew N. McGuire
andrew.mcguire@walgreens.com


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

Date: Fri, 12 May 2000 15:00:55 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: Regular expression ?
Message-Id: <391C62F7.9E1C674@walgreens.com>

"Andrew N. McGuire" wrote:

[ snip ]

> From the command line:
> 
> perl -ape '$_=$F[3]."\n"' file
> 
> seems to be the shortest.

  perl -pale '$_=$F[3]' file

Pointed out by my coworker, seems even shorter.  May not
be 3 chars, like the OP guessed, bu 8 aint bad.

Regards,

anm
-- 
Andrew N. McGuire
andrew.mcguire@walgreens.com


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

Date: Fri, 12 May 2000 13:19:53 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Regular expression ?
Message-Id: <391C6769.65880054@stomp.stomp.tokyo>

Jeff Zucker wrote:
 
> Larry Rosler wrote:

> >      '¦' ne '|'
 
> Thanks, Tad also tipped me to that via email.   
> It's ok, to quote myself from the same post 
> in which I made that error:  
> "Ha ha, what an idiot Jeff is."


I would not make reference to you as 
being an idiot. At times, I may elect
to think of you and your friends as
"excitable boys" but not idiots.

However, this does not reflect my
silent thoughts regarding behavior
displayed within newsgroups, from
time-to-time. There is a marked
difference between a person being
an idiot and person displaying
idiotic behavior.


Godzilla!


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

Date: 12 May 2000 21:48:30 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Regular expression ?
Message-Id: <slrn8hov1e.bgd.abigail@ucan.foad.org>

On 12 May 2000 17:41:03 GMT, Gordon Clemmons <perl_phreak@yahoo.com> wrote:
++ >tvn007@my-deja wrote:
++ 
++ >sorry, the input file is more complicate so I do not think I can use
++ >split.
++ >
++ >The actual input file would be something like this:
++ >        abc   : 0_0  2.02  A
++ >     305   : 0_0  2.01  A
++ >     306   : 0_0  1.80  AR
++ >      305   : 0_0  2.50  AR
++ 
++ Perlgolf anyone?
++ 
++ print + (split /\s+/, $_)[4] . "\n" while (<DATA>);

perl -pale'$_=$F[3]' file


Abigail


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

Date: Fri, 12 May 2000 16:51:34 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: Regular expression ?
Message-Id: <391C7CE6.177A923B@walgreens.com>

Abigail wrote:
> 
> On 12 May 2000 17:41:03 GMT, Gordon Clemmons <perl_phreak@yahoo.com> wrote:
> ++ >tvn007@my-deja wrote:
> ++
> ++ >sorry, the input file is more complicate so I do not think I can use
> ++ >split.
> ++ >
> ++ >The actual input file would be something like this:
> ++ >        abc   : 0_0  2.02  A
> ++ >     305   : 0_0  2.01  A
> ++ >     306   : 0_0  1.80  AR
> ++ >      305   : 0_0  2.50  AR
> ++
> ++ Perlgolf anyone?
> ++
> ++ print + (split /\s+/, $_)[4] . "\n" while (<DATA>);
> 
> perl -pale'$_=$F[3]' file

Copycat. ;^)

Regards,

anm
-- 
Andrew N. McGuire
andrew.mcguire@walgreens.com


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

Date: Fri, 12 May 2000 16:31:44 -0400
From: Ozette Brown <ozette.brown@infotechfl.com>
To: Michel Verheijen <Michel.Verheijen@nl.origin-it.com>
Subject: Re: remaining disk space
Message-Id: <391C6A30.E968D150@infotechfl.com>

Michel,

Try using a module called "DriveInfo.pm".

-Ozette

Michel Verheijen wrote:

> I'm running a Perl program in a Windows environment. Who knows how to get
> the remaining disk space on a specific drive? (Is there a function for that
> in Perl? If not, who knows how to do it?)
>
> Thanx,
> Michel



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

Date: Fri, 12 May 2000 11:14:19 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Running perl code thru crontab
Message-Id: <Pine.GSO.4.10.10005121110170.16364-100000@user2.teleport.com>

On Fri, 12 May 2000 vpanicker@my-deja.com wrote:

> I am facing problems running a perl code thru the crontab , as my env
> variable LD_LIBRARY_PATH is not getting set, which is not letting me
> call shared libraries. It seems %ENV in perl passes impoverished env.
> setting in cronjobs.

There's nothing perl-specific about that; I'm sure that your cron daemon
gives everyone the same environment.

Of course, you should probably fix your system installation so as not to
need the LD_LIBRARY_PATH. But if perl can start, you could set that
environment variable within a BEGIN block. And even if it can't (because
it uses one of the mis-installed shared libraries directly), you can
easily make a wrapper that /bin/sh can use to set the environment as
needed before launching your program.

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 12 May 2000 14:19:10 -0400
From: Nico Zigouras <zigouras@mail.med.upenn.edu>
To: vpanicker@my-deja.com
Subject: Re: Running perl code thru crontab
Message-Id: <Pine.OSF.4.21.0005121418290.2170-100000@mail.med.upenn.edu>

Did you try explicity setting the $ENV{'LD_LIBRARY_PATH'} in the top of
your script?  That should work AFAIK.


On Fri, 12 May 2000 vpanicker@my-deja.com wrote:

> Date: Fri, 12 May 2000 17:34:11 GMT
> From: vpanicker@my-deja.com
> Newsgroups: comp.lang.perl.misc
> Subject: Running perl code thru crontab
> 
> I am facing problems running a perl code thru the crontab , as my env
> variable LD_LIBRARY_PATH is not getting set, which is not letting me
> call shared libraries. It seems %ENV in perl passes impoverished env.
> setting in cronjobs.
> 
> Can anyone suggest a way out on this.
> Thanx
> With regards
> vinod
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.
> 



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

Date: 12 May 2000 19:28:26 GMT
From: Jim Ward <jfw@saltmine.radix.net>
Subject: semctl GETALL
Message-Id: <8fhm0q$7c2$1@news1.Radix.Net>

I'm playing around with SysV semaphores and want to do a 
semctl GETALL so I can check that I'm handling the semaphores 
correctly. Can anyone post some semctl GETALL code or point me to 
an example on the Web? The code I've come across shows you how 
to increment/decrement the semaphores, but not how to inspect values.


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

Date: Fri, 12 May 2000 11:45:33 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: sendmail on WinNT
Message-Id: <8fhjgl$2og$1@brokaw.wa.com>


DAVÉN SVEN-OLOV <sven.olov_daven@swipnet.se> wrote in message
news:%EXS4.1377$JL6.4294@nntpserver.swip.net...
> How do I send mail in a Windows NT Perl script?

You know this question has been asked just about every day for as long as I
can remember, so I checked the FAQ, and there it was:

perlfaq9: How do I send mail?

Lauren




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

Date: Fri, 12 May 2000 15:45:35 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: sendmail on WinNT
Message-Id: <8fhn8u$cft$1@slb1.atl.mindspring.net>

Lauren Smith <lauren_smith13@hotmail.com> wrote in message
news:8fhjgl$2og$1@brokaw.wa.com...
:
: DAVÉN SVEN-OLOV <sven.olov_daven@swipnet.se> wrote in message
: news:%EXS4.1377$JL6.4294@nntpserver.swip.net...
: > How do I send mail in a Windows NT Perl script?
: You know this question has been asked just about every day for as long as I
: can remember, so I checked the FAQ, and there it was:
:
: perlfaq9: How do I send mail?

Or possibly: How do I send email from ActivePerl? from the ActivePerl FAQ.

HTH

AmD

--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
The begginning of wisdom is the definitions of terms.
 - Socrates




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

Date: Fri, 12 May 2000 15:35:47 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Silencing module warnings.
Message-Id: <391C6B23.872CFAC7@walgreens.com>

Quick question,

    Is there a way to silence warn()'s that are coming
from a module?

I found:

open SAVEERR, '>&STDERR' or die "Can't copy stderr.\n";
open STDERR,  '>/dev/null' or die "Can't redirect stderr.\n";

 ...

close STDERR;
open STDERR, '>&SAVEERR' or die "Can't restore stderr.\n";
close SAVEERR;

works, and:

#!/usr/bin/perl -w

use strict;

for (1..20) {
   open NULL, '>/dev/null' 
       or die "Can't write to /dev/null: $!.\n;
   local *STDERR = 'NULL';
   warn "Test.\n";
}

warn "Test.\n";

Will only print out 'Test.' once, but it will not silence
warnings coming from a module.  I am using the File::Find
module, and do not want to see all the "Can't cd to..."
errors, and dont want to have the users do:

 ./script.pl 2> /dev/null

I have found a way to make it work, the first method above...
But there must be an easier way.

Cheers,

anm
-- 
Andrew N. McGuire
andrew.mcguire@walgreens.com


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

Date: 12 May 2000 20:17:41 GMT
From: abigail@foad.org (Abigail)
Subject: Re: The way to load a script on certain time by itself ?
Message-Id: <slrn8hopn5.bgd.abigail@ucan.foad.org>

On Thu, 11 May 2000 19:15:12 +0900, Alex Moltimer <moltimer@yahoo.com> wrote:
++ How to make to load a script on certain time by itself ?


How could it "load" (compiled? run?) itself while it's not "loaded" yet?



Abigail


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

Date: Fri, 12 May 2000 14:53:26 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: unresolved external in XSUB
Message-Id: <391C7D56.CC5B3121@jpl.nasa.gov>

Tom Phoenix wrote:
> On Fri, 12 May 2000 energon@my-deja.com wrote:
> > Environment: Solaris 2.6 and HP-UX 10.20  with Perl 5.002
> 
> > However, I get the following error
> > /usr/lib/dld.sl: Unresolved symbol: XS_unpack_charPtrPtr (code)  from
> > ./mytest.sl
> > on my HP-UX 10.20 box when I try to run my test.
> 
> I'd guess that you should upgrade perl on one or both of these machines,
> then make sure that the XS code works with the new perl. 5.002 is _quite_
> old, having been last maintained over four years ago, and missing out on
> the major security update in the summer of 1996.

An additional note - error messages such as this one are symptoms of
running a module with a different version of perl than the module was
built to run with.

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King


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

Date: 12 May 2000 19:47:27 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Where's the FAQ?
Message-Id: <8fhjjv$u5g$1@orpheus.gellyfish.com>

On Wed, 10 May 2000 22:56:01 +0100 Bagsy wrote:
> 
> Dave Cross <dave@dave.org.uk> wrote in message
> news:m3mjhsoicaocmhikoiq5ahv76nl1nnti44@4ax.com...
>> On Wed, 10 May 2000 19:23:49 +0100, "Bagsy"
>> <news@theedgeofpanic.freeserve.co.uk> wrote:
> 
>> > Can somebody post me a URL for the FAQ please?
> 
>> The faq was installed on your system when you installed Perl. Try
>> typing "perldoc perlfaq" at a command prompt.
> 
>     I haven't installed Perl on my system.
> 

Ah that'll be the problem then. Whilst there have been some imbeciles
in this group recently advocating that somehow it is a mark of weakness
to have Perl installed locally that you might test your programs, mostly
it is considered *a good thing* to have it installed.  Not only do you
get the FAQ you will also get a vast wealth of other documentation and
as an added bonus perl and an bunch of modules too ;-}  I would say that
it would take far less time to download and install Perl than it would
take to find and read the documentation on the web if you are worried
about connection charges.

You know it make sense.

/J\
-- 
Aw, Dad, you've done a lot of great things, but you're a very old man,
and old people are useless.
-- 
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 3032
**************************************


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