[13453] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 863 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 21 06:07:18 1999

Date: Tue, 21 Sep 1999 03:05:10 -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: <937908309-v9-i863@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 21 Sep 1999     Volume: 9 Number: 863

Today's topics:
    Re: answers <gellyfish@gellyfish.com>
    Re: answers (Eric Bohlman)
    Re: Changing Passwords from CGI Script with Perl? (Konstantin Wiesel)
    Re: Combining variables - newbie <nospam.newton@gmx.net>
    Re: Combining variables - newbie (Eric Bohlman)
    Re: Combining variables - newbie (Abigail)
    Re: Connecting to P.O.S. Devices ? (Eric Bohlman)
    Re: Error in "Learning Perl, 2nd Edition" or Error in P (Bart Lateur)
        Error writing to socket (CUESTA CUESTA)
    Re: Error writing to socket <espen@nextel.no>
        how can I use perl to convert each paragraph to one lon <wedeking@msa.attmil.ne.jp>
    Re: I don't want to extract data from an HTML page. (Abigail)
    Re: Is it a bug? (ActivePerl 519 on w'95) <JFedor@datacom-css.com>
    Re: Is it a bug? (ActivePerl 519 on w'95) (Eric Bohlman)
        mkdir bug under Sinix 5.43 (RM600)? <rudolpht@lsv-wuerttemberg.de>
    Re: mkdir bug under Sinix 5.43 (RM600)? (Abigail)
    Re: ODBC: Creating a System DSN with perl <tresing@hirs.osd.mil>
    Re: Perl Challenge <gellyfish@gellyfish.com>
    Re: Regulat Expressions and Tabulator Problems (Eric Bohlman)
    Re: Saving a list of filenames from directory into an a (Helgi Briem)
    Re: Some e-mails get sent, some don't (I.J. Garlick)
    Re: System Call only works on 4K of input <uli.brass@netcologne.de>
    Re: System Call only works on 4K of input <uli.brass@netcologne.de>
    Re: Web Mail (I.J. Garlick)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 21 Sep 1999 09:32:09 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: answers
Message-Id: <37e74289_2@newsread3.dircon.co.uk>

Andrew <casino@start.com.au> wrote:
> love the way people say...
> 'not a perl question'
> or
> 'read some doco'
> 
> is this because you are so arrogant or just don't know?
> 

Thats not a Perl question. I would suggest you ask in alt.flame ...

/J\
-- 
"While we've been on the air we've had reports that Prince Charles has
eaten beef on the bone" - Justin Webb, BBC One O'Clock News


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

Date: 21 Sep 1999 08:34:49 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: answers
Message-Id: <7s7fv9$t15@dfw-ixnews5.ix.netcom.com>

lt lindley (ltl@rgsun40.viasystems.com) wrote:
: I see this attitude from new posters surprisingly often.  I was
: wondering:  if this is representative of normal human behavior, why
: don't people walk into a party and say "you guys are all a bunch of
: loudmouth assholes!", then wander over to the keg and poor themselves
: a beer.

This doesn't directly address the issue, but it's related to something 
I've been thinking about a lot recently.  There's been quite a bit of 
discussion for some years regarding why people seem to behave differently 
in forums like Usenet groups than they behave in "real life."  Most of 
the offered explanations involve things like lack of non-verbal cues, 
lack of shame at insulting someone you can't see, etc.  But I've come to 
think there's something even more fundamental going on, namely that the 
kind of interaction that takes part in newsgroups really *doesn't have*
any "real-life" counterparts, and that the reason so many people who are 
new to it behave so badly is that they have no frame of reference for how 
to behave.

I simply can't think of any common "real-life" situation that consists of
a large group of strangers engaging in at-length unstructured
conversations on other than purely banal topics like the weather.  By 
"unstructured" I mean that most of the time such a group gets together to 
talk, it's part of a meeting with a formal agenda, live facilitator, or 
something like, but there are no such corresponding structures here.  
Most people have little or no experience carrying on substantial 
conversations with strangers.

Those of us who have been long-time participants in newsgroups have 
learned, generally through bitter experience, that certain things work in 
such a forum and others don't.  Which do and which don't are *not* 
obvious from experience with other situations.  Thus it behooves those of 
us with such experience to politely *but firmly* inform newcomers that 
there *are* certain conventions that need to be observed, that there are 
good reasons for them which will become apparent to anyone who 
participates at length, and that newcomers need to abide by those 
conventions if they want to participate in the community.  Flaming people 
who haven't demonstrated actual intransigence just makes them defensive; 
flaming should be reserved for those who demonstrate that they know the 
conventions but simply refuse to abide by them.  But wishy-washyness 
isn't any better; the problem with making exceptions "just this once" is 
that five minutes later, somebody else presents another "this once."

: I think it must be because we don't have any beer here.  usenet
: groups should serve beer if they expect new posters to be friendly
: and respectful.

I'll drink to that.



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

Date: 21 Sep 1999 07:49:27 GMT
From: uzs8n8@uni-bonn.de (Konstantin Wiesel)
Subject: Re: Changing Passwords from CGI Script with Perl?
Message-Id: <7s7da7$17a4@news.rhrz.uni-bonn.de>

In article <rwxF3.22904$N77.1812358@typ11.nn.bcandid.com>, kragen@dnaco.net 
says...
>
>In article <7s67i4$vbe@news.rhrz.uni-bonn.de>,
>Konstantin Wiesel <uzs8n8@uni-bonn.de> wrote:
>>I would like to change Passwords with Perl
>>but i dont know in detail how to proceed.
>>
>>I was thinking about calling passwd
>>but how do i pass the parameters, the way
>>i tried it was not successful.
>
>Use Expect.pm.

What is Expect.pm and what can it do for me?

>
>>Then i thought about using the crypt function
>>and changing the passwd file directly but then i would
>>have to change the process id in order to be able to
>>modify the passwd file.
>
>No, you need to change the uid, by making the Perl script setuid root.
>Don't do this unless you really know what you're doing.  My guess is
>that if you think you need to change the pid, you don't.

Correct, i would have to change the uid. Are Perl scripts
executed with the owners rights if the suid bit is set?

My CGI script ist executed with uid "wwwrun".
I would like to know if i can change the uid within Perl.

With my CGI Script i am reading the old and new passwords from
a html form and now would like to first validate the
form and then change the passwords.

I could do this by calling the passwd programm, but
i dont see how to pass the input stream to it correctly.
The way i tried it with shell redirection didnt work
and some other way i read in chapter 16.4 of the Perl Book
did not work either.

Can somebody point me in the right direction?



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

Date: Tue, 21 Sep 1999 10:44:57 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Combining variables - newbie
Message-Id: <37E74589.B26C1EA8@gmx.net>

Uri Guttman wrote:
> 
> i leave it as an exercise for the group to find more dumb ways. lets
> see how many we can come up with. the dumber the better.

$var3 = "$var1 $var2"; # this is probably what a lot of people would do

$var3 = join ('', reverse($var2, "\40", $var1));

Cheers,
Philip


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

Date: 21 Sep 1999 08:41:42 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Combining variables - newbie
Message-Id: <7s7gc6$t15@dfw-ixnews5.ix.netcom.com>

Uri Guttman (uri@sysarch.com) wrote:
: i leave it as an exercise for the group to find more dumb ways. lets see
: how many we can come up with. the dumber the better.

@arr1=split(//,$string1);
@arr2=split(//,$string2);
@arr3[0]=" ";
@arr4=(@arr1,@arr3,@arr2);
$string3="";
for ($i=0;$i<=$#arr4;$i++) {
  $string3=$string3.$arr4[$i];
}



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

Date: 21 Sep 1999 04:15:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Combining variables - newbie
Message-Id: <slrn7uejal.bj0.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCCXII September MCMXCIII in
<URL:news:x7emfs7tfl.fsf@home.sysarch.com>:
@@ 
@@ i leave it as an exercise for the group to find more dumb ways. lets see
@@ how many we can come up with. the dumber the better.


$var3 = qq [@{[$var1 => $var2]}];



Abigail
-- 
               split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_)  {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 21 Sep 1999 08:15:52 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Connecting to P.O.S. Devices ?
Message-Id: <7s7ero$t15@dfw-ixnews5.ix.netcom.com>

Peter M. Perchansky (pperchan@DynamicNet.net) wrote:
: Is there a web site, book, or other sources that discuss how you can connect
: Point-of-Sale devices (cash register, bar code, etc.) to an application
: written in Perl?

Not that I'm aware of.  Bar-code readers are usually designed so that 
their data looks like it's coming from the keyboard (either by using 
system drivers or by physically connecting to a keyboard port), so there 
should be no special programming considerations in using them.  Cash 
drawers usually connect via a serial port; there are a number of modules 
on CPAN for simplifying serial-port programming on various platforms (it 
does tend to be rather platform-specific).



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

Date: Tue, 21 Sep 1999 09:06:03 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Error in "Learning Perl, 2nd Edition" or Error in Perl port specific to Windows or ?
Message-Id: <37ea471e.3045426@news.skynet.be>

Uri Guttman wrote:

>always using 'sort keys' can be a waste of electrons unless
>you know how to speed it up. my idea saves all the hash lookups.

What hash lookups? You're not sorting by value. You're sorting by key.
Thus: extract the keys, so you get a list, sort the list, so you get an
array, and format print out the result.

What you do is extract the keys, format into a list, sort the list, and
print out the list.

Same operations. Same amount of operations. Only the execution order is
different.

Are you expecting 

	push @l, $_ while ($_, $c) = each %c;

to be actually faster than

	@l = keys %c;

? With that push()?!? I seriously doubt it.

In fact, the benchmarks say otherwise:

  use Benchmark;
  # random filling of hash
  # use a small integer as argument
  for my $i (1.. 1000) {
      $_ = rand 2<<16;
      $hash{sprintf '%04X', $_} = $_;
  }

  timethese(1<<shift, {
      'bare keys' => sub { my(@l); @l = keys %hash; },
      'bare each' => sub { my(@l,$k,$v); 
          push @l, $k while ($k,$v) = each(%hash); },
      'value each' => sub { my(@l,$k,$v); 
          push @l, "$k $v" while ($k,$v) = each(%hash); },
      'value keys' => sub { my @l = map { "$_ $hash{$_}" } keys %hash; }
  });
__END__
   bare each: 12 wallclock secs (11.26 usr +  0.00 sys = 11.26 CPU)
   bare keys:  2 wallclock secs ( 2.20 usr +  0.00 sys =  2.20 CPU)
  value each: 30 wallclock secs (30.38 usr +  0.00 sys = 30.38 CPU)
  value keys: 10 wallclock secs ( 9.29 usr +  0.00 sys =  9.29 CPU)


True, there is some penalty for the hash lookup. But your method is
still three times slower. (And potentially buggy!)

-- 
	Bart.


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

Date: 21 Sep 1999 07:29:17 GMT
From: jcuesta@tid.es (CUESTA CUESTA)
Subject: Error writing to socket
Message-Id: <7s7c4d$jab2@tid.tid.es>


  I'm writting in a socket. When the socket is closed in the other end, my
script ends without control. How can I trap the execution of the print in
a way that the script doesn't end? I want the script to be able to reconnect.
  Thanks

   J. Carlos




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

Date: Tue, 21 Sep 1999 10:26:01 +0200
From: Espen Myrland <espen@nextel.no>
Subject: Re: Error writing to socket
Message-Id: <37E74119.C4E98A19@nextel.no>

CUESTA CUESTA wrote:

>   I'm writting in a socket. When the socket is closed in the other end, my
> script ends without control. How can I trap the execution of the print in
> a way that the script doesn't end? I want the script to be able to reconnect.
>   Thanks
>
>    J. Carlos

I guess this is UNIX?

You can use a signal handler like

$SIG{PIPE} = \&pipehandler;

while <SOCKET>
blah
blah
if ($try){
    reconnect()
}

blh
blah



 .
 .sub pipehandler {
    local $SIG{PIPE} = 'IGNORE';
    $try = "YES";
}

 .
espen




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

Date: Tue, 21 Sep 1999 18:50:26 +0900
From: "Dan and/or Shelly" <wedeking@msa.attmil.ne.jp>
Subject: how can I use perl to convert each paragraph to one long sentence?
Message-Id: <7s7kdu$73r$1@news.misawa.attmil.ne.jp>

I want to convert the paragraphs in a file which are separated by blank
lines into
one long line for each paragraph by removing the newline characters from the
ends of
the lines.  I tried "sed" but "sed" doesn't seem to delete new line
characters although it does let you insert newline characters.  Then I tried
the following "sed" script:

sed -e'
:join
/^$/!{N
s/\n//
b join
}
infile > outfile

But when I tried to run the program, I got a bunch of "Line is too long"
error messages.
If it's too difficult for "sed" maybe perl can handle this task.  I tried
perl '/^$/!s/\n//g' infile > outfile
I was thinking I could remove the newlines from just the non-empty lines of
text and that the regular expression /^$/! would match on the non-blank
lines
and that the s/\n//g would delete the newline characters -
but for some reason that just give a bunch of error messages.  The think is,
though
I'll have to use win32 perl and not the unix perl because my computer
doesn't have
regular perl and my boss won't let me install it.  They don't like people
putting non-y2k
programs on the computers at work.

Dan




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

Date: 21 Sep 1999 04:24:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: I don't want to extract data from an HTML page.
Message-Id: <slrn7uejr2.bj0.abigail@alexandra.delanet.com>

Jody Fedor (JFedor@datacom-css.com) wrote on MMCCXII September MCMXCIII
in <URL:news:7s76h5$69d$1@plonk.apk.net>:
|| After searching Deja for an hour I beg a bone from the masters:
|| 
|| I would like to use "real html" files as templates.  Would like to know
|| if anyone has a collection of regexes that might process the html
|| file to be able to print it via the slurp the $html variable style. ie:

It's strange that you haven't found an answer. It has been posted here
many times that a regex to parse HTML doesn't cut the cake. You need to
parse it.

I am not aware of anything on CPAN that parses HTML in a useful way.
There's a module called HTML::Parser, but that doesn't parse, and has no
knowledge about HTML. However, if your templates don't to anything fancy
(that is, they validate, and they are dumbed down to MSIE/Netscape level),
you could use HTML::Parser as a tokenizer for your parser.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 21 Sep 1999 03:49:45 -0400
From: "Jody Fedor" <JFedor@datacom-css.com>
Subject: Re: Is it a bug? (ActivePerl 519 on w'95)
Message-Id: <7s7b29$bqg$1@plonk.apk.net>


Paulius wrote in message <8E485AA88kaktusasusanet@news.omnitel.net>...
>Hello,
>
>the program:
>
>#!perl -w
>
>@input = <>;
>
>foreach (@input) {
>  chop;
>  print "<LI>$_</LI>\n";
>}
>
>produces output:
>
>J:\test>perl test.pl
>aaa
>bbb
>ccc
><LI>aaa</LI>
><LI>bbb</LI>
><LI>ccc</LI>
>
>J:\test>perl test.pl
>aaa
>bbb
>ccc
><LI>bbb</LI>
><LI>ccc</LI>
>... and all following runs produces the last output...
>
I get alternating aaa bbb ccc then bbb ccc then aaa bbb ccc.  Wierd one!

Jody




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

Date: 21 Sep 1999 08:46:59 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Is it a bug? (ActivePerl 519 on w'95)
Message-Id: <7s7gm3$t15@dfw-ixnews5.ix.netcom.com>

Paulius (kaktusaz@takas.lt) wrote:
: #!perl -w
: 
: @input = <>;
: 
: foreach (@input) {
:   chop;
:   print "<LI>$_</LI>\n";
: }
: 
: produces output:
: 
: J:\test>perl test.pl
: aaa
: bbb
: ccc
: <LI>aaa</LI>
: <LI>bbb</LI>
: <LI>ccc</LI>
: 
: J:\test>perl test.pl
: aaa
: bbb
: ccc
: <LI>bbb</LI>
: <LI>ccc</LI>
: ... and all following runs produces the last output...
: 
: Why is this happening?

It's a bug in the Win32 console output routines (not in the perl
interpreter) that causes them to swallow the first line output after the
end of console input under some circumstances.  perl is actually
outputting the line with the 'aaa' but the console routines aren't
displaying it properly.  If you were to put your input in a file called
'myinput' and then run 'perl test.pl <myinput' you'd see all the results. 



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

Date: Tue, 21 Sep 1999 09:40:34 +0200
From: Tobias Rudolph <rudolpht@lsv-wuerttemberg.de>
Subject: mkdir bug under Sinix 5.43 (RM600)?
Message-Id: <HDTnN1oKLsmBrV12mkIU4ebp4YRB@4ax.com>

Hi all!

I´m a beginner with perl and i´m writing some perl scripts under Sinix
5.43 C4001 on a Siemens RM600 (2 R4000 processors, 512 mb).

I wonder why the mkdir command from perl doesn´t do what it should.

The script:


#!/opt/bin/perl -w

if(not mkdir("testdir", 0777))
{
     print("error: no mkdir!\n");
}
else
{
     # the test directory was created, but not with mode 777 :( - why?
     chmod(0777, "testdir");
     # now the directory has the correct mode :)  -- why now???
}


Is it my fault or is it a bug in the Sinix-perl?

Thanks in advance,

Tobias


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

Date: 21 Sep 1999 04:28:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: mkdir bug under Sinix 5.43 (RM600)?
Message-Id: <slrn7uek3i.bj0.abigail@alexandra.delanet.com>

Tobias Rudolph (rudolpht@lsv-wuerttemberg.de) wrote on MMCCXII September
MCMXCIII in <URL:news:HDTnN1oKLsmBrV12mkIU4ebp4YRB@4ax.com>:
## 
## I wonder why the mkdir command from perl doesn´t do what it should.
## 
##      # the test directory was created, but not with mode 777 :( - why?

Could it be that mkdir did what it said it will do in the second line
of the documentation?




Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 20 Sep 1999 14:15:35 -0500
From: Thomas Resing <tresing@hirs.osd.mil>
Subject: Re: ODBC: Creating a System DSN with perl
Message-Id: <37E687D6.29F7DC69@hirs.osd.mil>

Try changing the ODBC_ADD_DSN to a 4 like this:
Win32::ODBC::ConfigDSN(4,
                            $DriverType,
                            ("DSN=$DSN",
                            $Description,
                            "DBQ=$dir\\$DataBase",
                            "DEFAULTDIR=$dir",
                            "UID=user", "PWD=password"))
4 is the constant defined in the windows header file for ODBC_ADD_SYS_DSN
in the ODBC library being used by the WIN32::ODBC.
-Tom

AcCeSsDeNiEd wrote:

> How in the world do I create a System DSN with the ODBC.pm?
>
> I only know how to create a user dsn. The code goes something like
> this:
>
> Win32::ODBC::ConfigDSN(ODBC_ADD_DSN,
>                             $DriverType,
>                             ("DSN=$DSN",
>                             $Description,
>                             "DBQ=$dir\\$DataBase",
>                             "DEFAULTDIR=$dir",
>                             "UID=user", "PWD=password"))
>
> I don't find any thing about creating system dsn in the ODBC.pm docs.
>
> Thanks.
>
> To e-mail me, remove "_rm"

--
---------                ---------
---------                ---------
Thomas Resing    tresing@hirs.osd.mil
Software Engineer, Health Information Resources Services (HIRS)
HQ AFMSA/SGSJ, 2510 Kennedy Circle, Suite 208, Brooks AFB, TX 78235
Voice: 210-536-4022 Fax: 210-536-3070 DSN: 240-4022
---------                ---------
---------                ---------




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

Date: 21 Sep 1999 09:27:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Challenge
Message-Id: <37e7416c_2@newsread3.dircon.co.uk>

makau@multimania.com wrote:
> 
>> >Damn, seems I am far newbier than I ever thought :-)
>>
>> reviewing your short but colourful posting history to c.l.p.misc it
>> would seem very apparent .. if you thought you were anything but a
>> newbie then - yes - you are far newbier than you ever thought
> 
> Yeah, but I am pretty sure that in a very near future, you will need my
> help. 
> 

And what might that be about then ?

/J\
-- 
"If homo sapiens really were 'homo' sapiens is that why they're
extinct?" - Joey, Friends


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

Date: 21 Sep 1999 08:03:26 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Regulat Expressions and Tabulator Problems
Message-Id: <7s7e4e$t15@dfw-ixnews5.ix.netcom.com>

David Cassell (cassell@mail.cor.epa.gov) wrote:
: [2] This isn't optimal either.  If you want to do this,
: try something like:
: 
: { undef $/; $filelines = <FILE>; }

Er, make that 'undef' a 'local'; otherwise $/ won't get its value 
restored outside the block.



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

Date: Tue, 21 Sep 1999 09:30:57 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: Saving a list of filenames from directory into an array.
Message-Id: <37e75003.1287605318@frettir.simnet.is>

On Mon, 20 Sep 1999 15:34:53 -0400, George
<dgscapin@castaway.cc.uwf.edu> wrote:

>I am trying to find a way to save a list of jpeg and gif filenames from
>a given directory into an array.  I just need a simple way to do this. 
>Thank you in advance for the help.  I have tried some suggestions from
>the gurus through reading similar problems but haven't had any luck, so
>I need an answer to my specific problem.	
>
>george@thescapins.com

opendir DIR, "somedir/somesubdir";
@dirlist = readdir (DIR);
closedir DIR;


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

Date: Tue, 21 Sep 1999 08:23:18 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: Some e-mails get sent, some don't
Message-Id: <FIEHyv.8r7@csc.liv.ac.uk>

In article <MPG.125084b739b3831898975f@nntp1.ba.best.com>,
moseley@best.com (Bill Moseley) writes:
> What I've done quick and dirty (not for email address, but for other 
> user data where I know I shouldn't see any single quotes):
> 
> $adr =~ s/'/ /g; 
> 
> Now, what am I missing (besides a safe pipe open)?

How about ` & | [ ] { } ( ) ; all of which can make strange things happen
via most shells I have tried. Not sure about pipes but I wouldn't take the
chance, have a sneeky suspiscion that a pipe calls a shell and does shell
interpretation (or whatever).

There are probably others as well which is why it's never a good idea to
try to escape the problems, but to 'not escape' the safe instead. (Does
that make sense to anyone?).

	$adr =~ s/\W/ /g; #would be much safer (but probably way to restrictive.)

problem is I am really not convinced that this approach is all that good
either. (see my other post to this thread.)

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

Experience is that marvelous thing that enables you recognize a mistake
when you make it again.
                -- F. P. Jones



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

Date: Tue, 21 Sep 1999 11:30:10 +0200
From: "Uli Brass" <uli.brass@netcologne.de>
Subject: Re: System Call only works on 4K of input
Message-Id: <7s7jei$4ao$1@news.netcologne.de>


Christoph Wernli <cw@dwc.ch> schrieb in im Newsbeitrag:
37E65E22.DB1FEA6C@dwc.ch...
> I'm doing (almost) the exact same thing and haven't run into any problems.
The only
> difference to your setuo is that I don't use sudo, but run the script as
root instead. You
> might want to give that a try; else provide more infos.
>
> Cheers,
>

Thanks a lot! But the hint from Kragen Sitaker fixed my problem!
The file was not completely flushed / unbuffered before the makemap started.
Thanks for your help anyway!

Uli




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

Date: Tue, 21 Sep 1999 11:30:57 +0200
From: "Uli Brass" <uli.brass@netcologne.de>
Subject: Re: System Call only works on 4K of input
Message-Id: <7s7jej$4ao$2@news.netcologne.de>


Kragen Sitaker <kragen@dnaco.net> schrieb in im Newsbeitrag:
fDrF3.21999$N77.1761170@typ11.nn.bcandid.com...
>
> My guess is that you're not closing or flushing the filehandle to
> virtusertable before you run makemap.  Assuming the final virtusertable
> is between 4096 and 8192 bytes, and bufsiz is 4096 on your system, that
> would produce exactly the behavior you're seeing.
>

Thank you so much! This was exactly my problem! The makemap started before
the file was completely written out of the buffer on to the disk.
It works absolutely fine now! Many thanks!

Uli






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

Date: Tue, 21 Sep 1999 09:00:30 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: Web Mail
Message-Id: <FIEJov.9H6@csc.liv.ac.uk>

In article <7s6rhq$94k$1@news.yokota.attmil.ne.jp>,
"Jason Petrillo" <jasonp@yta.attmil.ne.jp> writes:
> Anyone out there have a suggestion for setting up Web Mail with Perl.  This
> would be from an existing customer base.

Oh it can be done. But unless you are prepared to use a large team of
programmers it may take a while. (Trust me on that one).

There may even be some ready to use options out there (but can you trsut
them with something like this, lots of code reviewing) but touting for
scripts here is generally classed as off topic.

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

Experience is that marvelous thing that enables you recognize a mistake
when you make it again.
                -- F. P. Jones



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

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


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