[24999] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7249 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 14 18:07:13 2004

Date: Thu, 14 Oct 2004 15: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)

Perl-Users Digest           Thu, 14 Oct 2004     Volume: 10 Number: 7249

Today's topics:
    Re: [newbie] shtml question <noreply@gunnar.cc>
    Re: [newbie] shtml question <dontmesswithme@got.it>
    Re: A newbie question <mritty@gmail.com>
    Re: A newbie question <matternc@comcast.net>
    Re: A newbie question <moon@world.universe>
    Re: A newbie question <nobull@mail.com>
    Re: A newbie question <moon@world.universe>
    Re: A newbie question <sbryce@scottbryce.com>
    Re: A newbie question <bik.mido@tiscalinet.it>
        find number of occurence for each unique values <jiangchanghao@hotmail.com>
    Re: find number of occurence for each unique values <1usa@llenroc.ude.invalid>
    Re: find number of occurence for each unique values <nobull@mail.com>
    Re: getting telnet banner <jay@rgrs.com>
        Help needed replacing deprecated syntax (Page)
    Re: How to package my perl scripts (that depend on othe <bik.mido@tiscalinet.it>
    Re: HTML::Parser and <p> behaviour? <1usa@llenroc.ude.invalid>
    Re: HTML::Parser and <p> behaviour? <1usa@llenroc.ude.invalid>
    Re: HTML::Parser and <p> behaviour? <1usa@llenroc.ude.invalid>
    Re: HTML::Parser and <p> behaviour? <bigal187@removethis.rx.eastcoasttfc.com>
    Re: HTML::Parser and <p> behaviour? <geoff.cox@removethisplease.freeuk.com>
    Re: is there a better way to mkdir? <richard@zync.co.uk>
    Re: is there a better way to mkdir? <abigail@abigail.nl>
    Re: is there a better way to mkdir? <bik.mido@tiscalinet.it>
    Re: Lagrange Interpolating Polynomial <bik.mido@tiscalinet.it>
    Re: Lagrange Interpolating Polynomial <nospam-abuse@ilyaz.org>
    Re: NET:TELNET data output <jay@rgrs.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 14 Oct 2004 22:08:39 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: [newbie] shtml question
Message-Id: <2t84m8F1sfl1vU1@uni-berlin.de>

Ben Morrow wrote:
> Quoth Gunnar Hjalmarsson <noreply@gunnar.cc>:
>> Would you mind explaining how rejecting that idea makes the OP an
>> idiot?
> 
> Being rude to someone trying to help is what makes him an idiot, as
> does stating (again) on Usenet how urgent the problem is (as though
> we care), using multiple exclamation marks, mis-capitalising Perl
> module names (Uri of couse gets an honourable exception to this :),
> and saying 'I need to pass a query string' when Gregory has just
> suggested how this might be done and any further problems he has
> with this are undoubtedly with SSI not Perl.

Thanks for replying. I for one had hoped for an apology to the OP.

I agree on some (not all) of what you say, but nothing of it justifies
that kind of name calling IMO.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Thu, 14 Oct 2004 21:39:09 GMT
From: Larry <dontmesswithme@got.it>
Subject: Re: [newbie] shtml question
Message-Id: <dontmesswithme-2D04E6.23354114102004@twister2.tin.it>

In article <slrncmrt7h.aj0.efflandt@typhoon.xnet.com>,
 efflandt@xnet.com (David Efflandt) wrote:

> You just need to get the QUERY_STRING from the environment and properly
> decode it, or use the Perl CGI module (perldoc CGI).

Just for the record:

<!--#include virtual="cgi-bin/script.cgi?${QUERY_STRING}" -->

thanks all the same


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

Date: Thu, 14 Oct 2004 18:12:03 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: A newbie question
Message-Id: <Tjzbd.335$HE1.187@trndny01>


"Paul Lalli" <mritty@gmail.com> wrote in message
news:67zbd.274$HE1.81@trndny01...
>
> $str = s/foo/bar/;   #replaces 'foo' with 'bar' within $str

Arg!  This is not my day.  That should be
$str =~ s/foo/bar/;

Sorry.  Again.

Paul Lalli




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

Date: Thu, 14 Oct 2004 14:58:25 -0400
From: Chris Mattern <matternc@comcast.net>
Subject: Re: A newbie question
Message-Id: <SNWdnfLZW5_MUfPcRVn-iA@comcast.com>

Paul Lalli wrote:

> variable $e within $_, and swaps those two instances.
> 
> This is, of course, completely pointless, as $e can only contain one
> value.  This has no net effect on the string in $_ whatsoever.

Wrong!  $e could contain a regular expression that matches different
things.

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


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

Date: Thu, 14 Oct 2004 21:01:26 +0200
From: Moon <moon@world.universe>
Subject: Re: A newbie question
Message-Id: <536qvj3l2fbu$.7wd0mseswlnj.dlg@40tude.net>

Dnia Thu, 14 Oct 2004 18:12:03 GMT, postmaniak Paul Lalli odważył się
napisać:

> Sorry.  Again.

Hey, don't bother to apologize me, I'm very grateful to all of you for your
help!!

Nevertheless, I have one last question (consisting of three sub-questions:)
Please help me with the following code:

$a = $c & 0xf; <-??
$b = $c >> 4; <-??

$abc =~ s/(.)/abc($1)/ge

What does it mean? I'd be extremely grateful if you'd explain it to me by
examples.

Thanks a lot.

PS. I'm trying to convert a Perl-script into a C code. Above three lines
are the last ones I don't know what to do with...:/



-- 
<Moon>
[adres Reply-To zaszyfrowany ROT13]


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

Date: Thu, 14 Oct 2004 20:43:28 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: A newbie question
Message-Id: <ckmkkg$4nd$1@sun3.bham.ac.uk>

Moon wrote:

> Nevertheless, I have one last question (consisting of three sub-questions:)
> Please help me with the following code:
> 
> $a = $c & 0xf; <-??
> $b = $c >> 4; <-??
>
> $abc =~ s/(.)/abc($1)/ge
> 
> What does it mean? I'd be extremely grateful if you'd explain it to me by
> examples.

It would be much more productive if you were to tell us exactly what 
part of the explainations of the &  >>and s/// operators given in the 
manual you are having difficulty understanding.  That way we not only 
get to help you but also can improve the documentation for the next person.

> PS. I'm trying to convert a Perl-script into a C code. Above three lines
> are the last ones I don't know what to do with...:/

The & and >> operators in Perl are borrowed from C anyhow.




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

Date: Thu, 14 Oct 2004 22:01:04 +0200
From: Moon <moon@world.universe>
Subject: Re: A newbie question
Message-Id: <1igaw820t8njw$.1vccpurwzk9pk.dlg@40tude.net>

Dnia Thu, 14 Oct 2004 20:43:28 +0100, postmaniak Brian McCauley odważył się
napisać:

> The & and >> operators in Perl are borrowed from C anyhow.
Yes, I managed to figure it out already:)

Well I don't want to bother you, so maybe go for the simple solution. I
don't want to learn Perl (sorry:) - so maybe you just run the below script
on your machine and send me the results? This would help me very much.

Script:

------------
sub swap($$)
{
    $_ = shift;
    $e = "." x shift;
    s/($e)($e)/$2$1/g;
    return $_;
}

$k = "lmnopqrstuvwxyz{";

print (swap($k, 8));
print (swap(swap($k, 4), 1);
print (swap(swap($k, 8), 1);
print (swap($k, 1);
print (swap($k, 4);
print (swap($k, 2);
print (swap(swap($k, 2), 1);
print (swap(swap(swap($k, 4), 2), 1);
-----------

I just would like to get the output (8 lines of swap's).
Thanks, and... sorry to bother you, again.

-- 
<Moon>
[adres Reply-To zaszyfrowany ROT13]


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

Date: Thu, 14 Oct 2004 15:28:44 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: A newbie question
Message-Id: <10mtrs838p5td59@corp.supernews.com>

Moon wrote:

> Well I don't want to bother you, so maybe go for the simple solution. I
> don't want to learn Perl (sorry:) - so maybe you just run the below script
> on your machine and send me the results? This would help me very much.

syntax error at C:\Scratch\killme.pl line 12, near ");"
syntax error at C:\Scratch\killme.pl line 13, near ");"
syntax error at C:\Scratch\killme.pl line 14, near ");"
syntax error at C:\Scratch\killme.pl line 15, near ");"
syntax error at C:\Scratch\killme.pl line 16, near ");"
syntax error at C:\Scratch\killme.pl line 17, near ");"
syntax error at C:\Scratch\killme.pl line 18, near ");"

Perhaps this would work better if you installed Perl on your machine and 
worked this out yourself? Even with the syntax errors corrected, I doubt 
the output will be as helpful as you expect.

But, in case I'm wrong...
tuvwxyz{lmnopqrsqpsrmlonyx{zutwvutwvyx{zmlonqpsrmlonqpsrutwvyx{zpqrslmnoxyz{tuvwnolmrspqvwtuz{xyonmlsrqpwvut{zyxsrqponml{zyxwvut

If you can program in C, you can find and fix the syntax errors in your 
Perl script. I don't know if the regulars here want to run every 
iteration of your script until you finally get the output you want.




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

Date: Fri, 15 Oct 2004 00:06:31 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: A newbie question
Message-Id: <2ustm016bpg7cln123o32bnaspaucoi1vu@4ax.com>

On Thu, 14 Oct 2004 18:51:36 +0200, Moon <moon@world.universe> wrote:

>I don't have Perl experience at all, but I would be *VERY* grateful if
>someone could translate me the piece of code shown below into a "human
>language" :)

In a human language it is a badly written snippet of perl code. Others
have already explained you what it does.

Now I have one question for you: you were very polite by clearly
stating that you don't have any Perl experience and that despite this
you would like to know what this particular code does. In this sense
it seems acceptable to help you by giving you the info you asked for.

What is not clear to me is wether you're actually interested in
learning perl, for if you're not, an answer of the kind you asked for
is definitely ok, but otherwise you must be prepared to consider "read
the docs!" as a good answer.

In fact later on this thread you've been asking things like '"shift"
what?'. Then, if you just want a loose answer suffice to say that (in
a sub) it's way to pass parameters. If you whant to detailedly know
what's going on than either any introductory book or the documentation
will give you the relevant info.

As far as the code goes:

>$abc = shift;
>
>sub swap($$)
>{
>    $_ = shift; <- ??
>    $e = "." x shift; <- ??
>    s/($e)($e)/$2$1/g; <- all I know is that this is a 'regular expression'
>    return $_; <- function returns a value, I understand that one
>}

since I claimed it to be badly written, here's how I'd rewrite it:

  use strict;   # at the beginning of the script!
  use warnings;
  
  # ...
  
  sub swap ($$) {
      local $_=shift;
      my $n=shift;
      s/(.{$n})(.{$n})/$2$1/g;
      $_;
  }


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Thu, 14 Oct 2004 15:26:47 -0500
From: Changhao Jiang <jiangchanghao@hotmail.com>
Subject: find number of occurence for each unique values
Message-Id: <ckmne7$l49$1@news.ks.uiuc.edu>

I am wondering how to use the shell utility "sort" or similar tools to 
find out the number of occurrences for each unique value in a data file. 
For example, if I use "sort -u -n", it will list all the unique values 
in order. But there is no information about how many instances for each 
unique value. I know this should be trial to implement in perl with hash 
table. But since it is so useful, there might be a shell command with 
appropriate switch to do the same thing. Any thoughts are appreciated.


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

Date: 14 Oct 2004 20:52:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: find number of occurence for each unique values
Message-Id: <Xns9582ABBC39E24asu1cornelledu@132.236.56.8>

Changhao Jiang <jiangchanghao@hotmail.com> wrote in news:ckmne7$l49$1
@news.ks.uiuc.edu:

> I am wondering how to use the shell utility "sort" or similar tools to 
> find out the number of occurrences for each unique value in a data file. 

Then you are not asking in the right place, are you?

Sinan


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

Date: Thu, 14 Oct 2004 21:46:02 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: find number of occurence for each unique values
Message-Id: <ckmo9q$6he$1@sun3.bham.ac.uk>



Changhao Jiang wrote:

> I am wondering how to use the shell utility "sort" or similar tools to 
> find out the number of occurrences for each unique value in a data file.
> For example, if I use "sort -u -n", it will list all the unique values 
> in order. But there is no information about how many instances for each 
> unique value. I know this should be trial to implement in perl with hash 
> table. But since it is so useful, there might be a shell command with 
> appropriate switch to do the same thing. Any thoughts are appreciated.

I think that a Perl newsgroup is not the right place to ask questions 
about Unix shell scripting.

BTW 'sort | uniq -c' is usually a fairly early example in Unix shell 
scripting tutorials.



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

Date: Thu, 14 Oct 2004 17:38:25 -0400
From: Jay Rogers <jay@rgrs.com>
To: zebee@zip.com.au
Subject: Re: getting telnet banner
Message-Id: <kwpsm8hou9a.fsf@panix5.panix.com>

Zebee Johnstone <zebee@zip.com.au> writes:
> I want to connect to a machine's telnet server, read its banner, and
> disconnect.
>
> Net::Telnet doesn't appear to read banners, it doesn't return info till
> you log on.

Not true.  If you don't want to login, then just don't call
Net::Telnet::login().

This will do what you ask for:

    use Net::Telnet;
    $t = new Net::Telnet;
    $t->open($host);
    ($banner) = $t->waitfor('/login: ?$/');
    $t->close;


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

Date: 14 Oct 2004 14:12:00 -0700
From: dummymb@hotmail.com (Page)
Subject: Help needed replacing deprecated syntax
Message-Id: <6742094.0410141312.1514fcae@posting.google.com>

I received the following message:

C:\Program Files\Apache Group\Apache2\cgi-bin\corr>perl -wc corrdetail.pl
Using an array as a reference is deprecated at corrdetail.pl line 106 (#1)
    (D deprecated) You tried to use an array as a reference, as in
    < @foo-[23] >> or < @$ref-[99] >>.  Versions of perl <= 5.6.1 used to
    allow this syntax, but shouldn't have. It is now deprecated, and will be
    removed in a future version.

corrdetail.pl syntax OK

Here is the offending line:
my $msg = @_->[0];

What is the current proper syntax for such a statement?

Thanks.


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

Date: Fri, 15 Oct 2004 00:06:21 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How to package my perl scripts (that depend on other utils)
Message-Id: <e3itm0l4kqehn05vs243pd5cll9sjd8p7b@4ax.com>

On 14 Oct 2004 08:54:24 -0700, markus.cl@gmx.de (Markus Dehmann)
wrote:

>> Assuming it's for a *nix-like environment, have you considered writing 
>> an rpm?
>
>I thought I could maybe use the Perl Packager, given that the part I
>wrote is perl. But an RPM is a good idea, too. On the other hand,
>LaTeX packages are not available as RPMs as far as I know. So, it
>would be difficult to state the dependencies...

Also, not all (*NIX, and even Linux) world is using RH, Suse or
Mandrake...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 14 Oct 2004 20:02:33 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <Xns9582A331DADDasu1cornelledu@132.236.56.8>

Geoff Cox <geoff.cox@removethisplease.freeuk.com> wrote in
news:2v1tm0hflv0ug2v8e2mn1m9bh6kadpqodf@4ax.com: 

> On 14 Oct 2004 12:58:29 GMT, "A. Sinan Unur"
> <1usa@llenroc.ude.invalid> wrote:
> 
> 
>>You might want to check all the examples in 
>>http://search.cpan.org/src/GAAS/HTML-Parser-3.36/eg/
> 
> Thanks - will have a look now. By the way I have used your suggestions
> which work fine for <h2> and <p> but am findng that if I use the same
> approach for <ul> and <li> to parse <ul> <li> <li> </ul> I get the
> text doubled up in the <li> line. Works fine if I leave out the <ul> !

Again, no code.

You are probably forgetting that the only content of ul consists of a 
number of li's. Hence, you should not be printing any text for ul.

But, I am going to stop now.

You do need to provide code that other people can run with minimal effort. 

Sinan.


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

Date: 14 Oct 2004 20:05:26 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <Xns9582A3AEB575Casu1cornelledu@132.236.56.8>

Ben Morrow <usenet@morrow.me.uk> wrote in news:t1k042-e96.ln1
@osiris.mauzo.dyndns.org:

> 
> Quoth "A. Sinan Unur" <1usa@llenroc.ude.invalid>:
>> Geoff Cox <geoff.cox@removethisplease.freeuk.com> wrote in
>> news:a31rm05784u5g7stoojk2rogj49dfn35t1@4ax.com: 
>> 
>> > OK - does the code below help? In fact there are 2 questions here. 
>> > 
>> > 1.  if I have a paragraph of text between <p> and </p> I find that the
>> > text is broken into two parts producing
>> 
>> Here is the relevant part from your code:
>> 
> <snip>
>> 
>> I suspect the handler is being called multiple times, each time with a 
>> different part of the original text. 
> 
> ...as indeed the HTML::Parser documentation says it will be. 

I should have pointed that out. It was not my intention to imply that there 
was anything mysterious going on.

> You can prevent this with the ->unborken_text method [typo left because 
> it amused me :)]

:)

Sinan.


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

Date: 14 Oct 2004 20:11:30 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <Xns9582A4B608311asu1cornelledu@132.236.56.8>

"David H. Adler" <dha@panix.com> wrote in
news:slrncmt9q2.ovg.dha@panix2.panix.com: 

> On 2004-10-14, A. Sinan Unur <usa1@llenroc.ude.invalid> wrote:
>> "187" <bigal187@removethis.rx.eastcoasttfc.com> wrote in 
>> news:2t6oieF1sinaeU1@uni-berlin.de:
>>
>>> A. Sinan Unur wrote:
>>
>>>> OTOH, I would think that someone who wishes to appear friendly
>>>> might want to avoid the nickname '187'.
>>> 
>>> Why is that? This is how I uniquely identify myself. If "187" means
>>> something else that I am not awre of please let me know. 
>>
>> I assumed 'eastcoastttfc.com' indicated that you were US based. I
>> might have jumped to a conclusion there. FYI, AFAIK, 187 is the
>> police code for homicide. You might guess what that name might signal
>> to at least some others.
> 
> Just as a data point:
> 
> Last I checked, I live in the US, and I don't actually know any police
> codes, and I'm pretty sure most people I know don't either. So those
> being offended by this might be a rather small group...

It is not a matter of being offended. I am not American, and only learned 
of the meaning of 187 after seeing the movie by that name. 

http://www.imdb.com/title/tt0118531/

So, I presumed I was dealing with a killuh-wannabe high school kid.

Sinan.


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

Date: Thu, 14 Oct 2004 14:27:36 -0700
From: "187" <bigal187@removethis.rx.eastcoasttfc.com>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <2t89c3F1todspU1@uni-berlin.de>

A. Sinan Unur wrote:
> "David H. Adler" <dha@panix.com> wrote in
> news:slrncmt9q2.ovg.dha@panix2.panix.com:
>
>> On 2004-10-14, A. Sinan Unur <usa1@llenroc.ude.invalid> wrote:
>>> "187" <bigal187@removethis.rx.eastcoasttfc.com> wrote in
>>> news:2t6oieF1sinaeU1@uni-berlin.de:
>>>
>>>> A. Sinan Unur wrote:
>>>
>>>>> OTOH, I would think that someone who wishes to appear friendly
>>>>> might want to avoid the nickname '187'.
>>>>
>>>> Why is that? This is how I uniquely identify myself. If "187" means
>>>> something else that I am not awre of please let me know.
>>>
>>> I assumed 'eastcoastttfc.com' indicated that you were US based. I
>>> might have jumped to a conclusion there. FYI, AFAIK, 187 is the
>>> police code for homicide. You might guess what that name might
>>> signal to at least some others.
>>
>> Just as a data point:
>>
>> Last I checked, I live in the US, and I don't actually know any
>> police codes, and I'm pretty sure most people I know don't either.
>> So those being offended by this might be a rather small group...
>
> It is not a matter of being offended. I am not American, and only
> learned of the meaning of 187 after seeing the movie by that name.
>
> http://www.imdb.com/title/tt0118531/
>
> So, I presumed I was dealing with a killuh-wannabe high school kid.
>
> Sinan.


Wow. Never even heard of that movie before. Must be one of those films
that "falls through the cracks." No offense taken though. The main
reason I gave up using my real name on message forums was I kept being
associated with entities I had nothing to do with, such as a certain
corporation. It literally drove me nuts after the 10,000th time, so I
decided to use a nick name; the number 187 is a blend of the birth years
of my grand parents - 19/17/ and 19/18/, and "187" also sounded better
to me than "178", so I stuck with it. :-)




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

Date: Thu, 14 Oct 2004 21:33:06 GMT
From: Geoff Cox <geoff.cox@removethisplease.freeuk.com>
Subject: Re: HTML::Parser and <p> behaviour?
Message-Id: <u1stm0td79b036evvjompqr61c9pl1lokn@4ax.com>

On 14 Oct 2004 20:02:33 GMT, "A. Sinan Unur"
<1usa@llenroc.ude.invalid> wrote:

>Geoff Cox <geoff.cox@removethisplease.freeuk.com> wrote in
>news:2v1tm0hflv0ug2v8e2mn1m9bh6kadpqodf@4ax.com: 
>
>> On 14 Oct 2004 12:58:29 GMT, "A. Sinan Unur"
>> <1usa@llenroc.ude.invalid> wrote:
>> 
>> 
>>>You might want to check all the examples in 
>>>http://search.cpan.org/src/GAAS/HTML-Parser-3.36/eg/
>> 
>> Thanks - will have a look now. By the way I have used your suggestions
>> which work fine for <h2> and <p> but am findng that if I use the same
>> approach for <ul> and <li> to parse <ul> <li> <li> </ul> I get the
>> text doubled up in the <li> line. Works fine if I leave out the <ul> !
>
>Again, no code.

No need for any code this time! I see what you mean below and have got
that working now!

Thanks

Geoff

>You are probably forgetting that the only content of ul consists of a 
>number of li's. Hence, you should not be printing any text for ul.
>
>But, I am going to stop now.
>
>You do need to provide code that other people can run with minimal effort. 
>
>Sinan.



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

Date: Thu, 14 Oct 2004 20:58:40 GMT
From: Richard Gration <richard@zync.co.uk>
Subject: Re: is there a better way to mkdir?
Message-Id: <pan.2004.10.14.20.53.26.761302@zync.co.uk>

On Thu, 14 Oct 2004 16:46:48 +0000, Anno Siegel wrote:

> Richard Gration  <richard@zync.co.uk> wrote in comp.lang.perl.misc:
<SNIP>
> There is no such thing as "unix mkdir".  Most modern brands of unix
> appear to have the -p flag for mkdir, but I wouldn't bet my portability
> on it.
> 
>> 	system 'mkdir -p jerry/tom/spike'
>> 
>> will succeed regardless of whether jerry or tom already exist.
> 
> On which systems?

You're right, I should be more specific. Linux mkdir will behave as I
described.

R


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

Date: 14 Oct 2004 21:35:51 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: is there a better way to mkdir?
Message-Id: <slrncmts9m.34g.abigail@alexandra.abigail.nl>

Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMMMLXII
September MCMXCIII in <URL:news:ckmaho$ba0$2@mamenchi.zrz.TU-Berlin.DE>:
:)  Richard Gration  <richard@zync.co.uk> wrote in comp.lang.perl.misc:
:) > On Thu, 14 Oct 2004 08:56:27 -0700, wana wrote:
:) > 
:) > > I was wondering, why can't I create a whole path at once
:) > > like:
:) > > 
:) > > mkdir mouse/cat/dog
:) > > 
:) > > where none of the three directories exist yet.
:) > > 
:) > > This is what I came up with, but I thought there might be another way
:) > > or a better way to do it.
:) > 
:) > Dunno about a perl solution but unix mkdir supports a -p flag for this, so
:)  
:)  There is no such thing as "unix mkdir".  Most modern brands of unix
:)  appear to have the -p flag for mkdir, but I wouldn't bet my portability
:)  on it.

The POSIX requirement for support of options of utilities is often not
broad. But it does require -p for mkdir.

Portability is overrated anyway. I claim that the fast majority of the
Perl scripts that are written will only run on one system anyway.

:) > 	system 'mkdir -p jerry/tom/spike'
:) > 
:) > will succeed regardless of whether jerry or tom already exist.
:)  
:)  On which systems?

Any POSIX compliant system. Including Windows with a Unix compatability 
toolset (like cygwin) installed.

Sure, a Unix Version 7 system will not have 'mkdir -p'. I'm willing to
take a bet that the OP doesn't run Unix Version 7. (Does Perl even run
on Unix Version 7?)


Abigail
-- 
   my $qr =  qr/^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
      $qr =~  s/$qr//g;
print $qr, "\n";


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

Date: Fri, 15 Oct 2004 00:06:30 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: is there a better way to mkdir?
Message-Id: <lhstm0dunsmm5omtm8atkopfbb63g99cdt@4ax.com>

On 14 Oct 2004 08:56:27 -0700, ioneabu@yahoo.com (wana) wrote:

>I use mkdir in a program which recursively searches through a
>directory searching for files of a particular type and recreating the
>directory structure elsewhere and the files (which happen to be images

Well, I tend to avoid using perl just to launch a bunch of system()
cmds as many people does (but then they do much worse things like
calling grep, sed, etc. in those system()s), and I've hardly used any
until recently when I had to quickly hack up a script that does
something very similar to what you need, for which neither a pure *sh
script nor a "pure Perl one" (in a loose, but hopefully clear, sense)
would satisfy my laziness (you do remember that virtue called
'laziness', don't you?), so I used an external 'mkdir -p' which is
working great for me. It won't be available on all systems though.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Thu, 14 Oct 2004 20:24:39 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Lagrange Interpolating Polynomial
Message-Id: <s2htm0hq00f9s6u7a9liqa90m55gnr78t4@4ax.com>

On 13 Oct 2004 16:26:30 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:

>> Since we're taliking about mathematics now, by any chance do you
>> happen to be a relative to C.L. Siegel?
>
>No, I'm not.

Well, you could say your cds are Siegel discs, anyway! ;-)


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Thu, 14 Oct 2004 20:26:20 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Lagrange Interpolating Polynomial
Message-Id: <ckmndc$2igh$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Brian Troutwine 
<goofy_headed_punk@msn.com>], who wrote in article <pan.2004.10.12.04.57.36.150719@msn.com>:
> use Math::BigRat;

Did you try Math::Pari?  It may even have interpolation builtin...
Right, it is polint()...

Hope this helps,
Ilya


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

Date: Thu, 14 Oct 2004 17:52:41 -0400
From: Jay Rogers <jay@rgrs.com>
To: bigdogdan2@gmail.com (bigdogdan2)
Subject: Re: NET:TELNET data output
Message-Id: <kwpk6ttotli.fsf@panix5.panix.com>

bigdogdan2@gmail.com (bigdogdan2) writes:
> Is there a way I can get NET::TELNET to print out the data realtime
> instead of after the command is finished?

You can send the command and read its response a block at a
time:

    use Net::Telnet;
    $t = new Net::Telnet(-prompt => "/\\Q$prompt\\E\$/");
    $t->open($host);
    $t->login($user, $passwd);
    
    $t->print("a.sh");
    
    while ($blk = $t->get) {
        print $blk;
        $buf .= $blk;
    
       last if $buf =~ /\Q$prompt\E$/;
    }

or you can just make input_log() (i.e. the bytes read from
the remote host) go to stdout:

    $t->input_log(\*STDOUT);
    $t->cmd(-string => "a.sh",
            -timeout => 60);


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 7249
***************************************


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