"Bob Showalter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> print tbody(
>Tr(
> [map { s/([^\n\r]+)[ \t\n\r]+$/$1/; td([split /\t/]) }
> <$tabbed_text_fh>]
>)
> );
Thanks, though as usual, I've got another perldoc reference to lookup
("map").
>
> I'm not sure wha
A few days back I decided that all the html formating I've been doing with
Perl had probably been done before; so now I'm reading 'perldoc CGI'.
Anyway, in my (newsgroup simplified) old code I had the following;
print " \n";
while (<$tabbed_text_fh>) {
tabbed_text_2_html_table_row_
"Rob Dixon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Jamie Risk wrote:
> > I've no control over the EOL of text files that I'm processing; is
> > there a conveniant method using chomp() and the
> > INPUT_RECORD_SEPERATOR ($/)
I've no control over the EOL of text files that I'm processing; is there a
conveniant method using chomp() and the INPUT_RECORD_SEPERATOR ($/) to
handle DOS/UNIX/MAC generated text files automatically?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECT
I'm trying to add HTML anchors to a lines of text. Quick example would be
to take the line:
"Search the internet using an engine like Google."
and turn it into:
"Search the internet using an engine like Google."
In the past, I've contructed hash tables from text files having delimited
key-v
Until now, I've avoided writing modules by inlining the deisred code in the
new files. Messy. I'm avoiding modules for two reasons, laziness and naive
conception that for what I'm trying to do it's overkill.
Is there a method to reference code in other files, like, a simple
"include"?
--
To
er, sorry.
Is there a module to produce html formatted output? If so, would I be
directed to some documentation?
> > I have to assume that any of the simple HTML-izing I want to do
> > with simple text files has already been done. I'm guessing
> > modules, particularly "CGI" but would appreciate
I have to assume that any of the simple HTML-izing I want to do with simple
text files has already been done. I'm guessing modules, particularly "CGI"
but would appreciate a directed pointer to docs.
- Jamie
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
> I think we can safely assume that Jamie meant the other definition...
Alas, that's true. Good thing people gave me the benefit of the doubt.
All sorts of useful information comes from asking a question on this group!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-
I'm a casual PERL programmer at best, and I have a working facsimile of the
non-working code below. When I run it, I get an error "print() on closed
filehandle $fh at ./test.pl line [n]".
This is just my first step to being able to pass file handles to my
sub-routines. What have I missed?
open
Your response is a fascinating example of the word! ;)
"Rob Dixon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi Jamie.
>
> Jamie Risk wrote:
> >
> > It's been my experience that readers of this group relish a
> > demonstr
Thanks, pleasingly simple.
> CHOOSE ONE (untested).
>
> #
> # list slice (v. ugly)
> #
> my ($desc, @list) = (split /\t/, $_, 6)[4,0..3,5];
>
> #
> # splice
> #
> my @list = split (/\t/, $_, 6);
> my $desc = splice(@list, 4, 1);
>
--
To unsubscribe
It's been my experience that readers of this group relish a demonstration of
their persnicketiness. For this I give the following; it works, but doesn't
appeal to me:
my @tmp_list;
my @list;
my $description;
push @tmp_list, split(/\t/,$_,6);
push @list, $tmp_list[0],
$tmp_list[1],$
> So I tried:
> s/(.+)[ \t\n\r]*/$1/
> but those tricky little CR are still there. Even
> s/(.+)[ \t\n\r\015]*/$1/
> still eludes me.
And then I tried:
s/([^\n\r]+)[ \t\n\r]*$/$1/;
which does work, but seems overly finicky to get rid of BG's legacy. Is
there a better way?
--
To unsubscr
Okay, I do know that binary transfer of a text file between DOS and Unix
systems is a non-non, but my Samba setup isn't that discriminating.
Perl is running on a Unix platform, and 'chomp' isn't quite up to the task
of removing CR (ASCII '\r' or 0x0D).
So I tried:
s/(.+)[ \t\n\r]*/$1/
but those
Never mind, although perhaps someone can explain what "split(/''/)" is
doing. It satisfies my needs, but I don't know why (emphasis on the '' bit
between the / /).
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
How would I split, then push onto a list a variable length text string
with quoted portions (example following) so that a split keeps text
in quotes together.
"keep me together" separate1 separate2 separate3 "keep me together too"
separate4
If the above were parsed, I should like to see six sep
... without encapsulating each line in double quotes? I've seen this, and
don't know where.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
How does one do this?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
(sheepishly) Thanks.
> Perl's random number function is called "rand".
>
> perldoc -f rand
>
> my $num = int rand 2 ** $bits;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I'm thinking I could open up "/dev/urandom/" but that hardly seems portable.
"Jamie Risk" <[EMAIL PROTECTED]> wrote in message
b1enfr$evm$[EMAIL PROTECTED]">news:b1enfr$evm$[EMAIL PROTECTED]...
> I'm looking around, and I see "Quantum::En
I'm looking around, and I see "Quantum::Entanglement" which looks like
overkill; I'd like to generate, 8/16/32 bit random numbers.
- Jamie
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Thanks.
Knowing where to find the information is usually more than half the battle;
I appreciate the 'perldoc' references as well as your precis.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
The question stems from the fact that I don't really know what 'type' a file
handle is; and I'm also confused about what
open FILEHANDLE
does as opposed to,
open FILEHANDLE, $my_file
- Jamie (@21 hours of PERL and counting)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional com
ldoc perlreftut" and "perldoc
perlref"
> and "perldoc perllol".
>
> -Original Message-
> From: Jamie Risk [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 29, 2003 3:03 PM
> To: [EMAIL PROTECTED]
> Subject: Re: creating hash from name/value
Thanks, Timothy, I almost had it before I decided to look back at the list.
My only concern was the creation of data space for each new key, I guess
it's a non issue. ALTHOUGH, if I have repetitions of keys, code below would
obliterate previous key data, would it not? I guess I'm looking at a hash
Okay, it's 5:25pm and I started programming PERL shortly after downloading
the 5.8.0 tarballs at 2:30pm.
I'd like to create a hash from a text file that has name/value pairs, one
per line. So far, I'm only capable of reading it in as a list - this PERL
stuff really seems easy - but can I (excuse th
27 matches
Mail list logo