Thomas Bätzler wrote:
Tom Allison <[EMAIL PROTECTED]> wrote:
OK, perl almost has a problem with how many different ways to
make web pages.
I was looking around for something that was simple but mostly
fast and "common"
You might also want to check out Embperl and Mason - the latter
being
Tom Allison wrote:
OK, perl almost has a problem with how many different ways to make web
pages.
I was looking around for something that was simple but mostly fast and
"common" (meaning I'll find mention of it in job postings some day...).
Template and HTML::Template seem to be some pretty
Tom Allison <[EMAIL PROTECTED]> wrote:
> OK, perl almost has a problem with how many different ways to
> make web pages.
>
> I was looking around for something that was simple but mostly
> fast and "common"
You might also want to check out Embperl and Mason - the latter
being an extension buil
OK, perl almost has a problem with how many different ways to make web pages.
I was looking around for something that was simple but mostly fast and "common"
(meaning I'll find mention of it in job postings some day...).
Template and HTML::Template seem to be some pretty good starting points
[EMAIL PROTECTED] wrote:
>
> I have a list of names, separated by the '/' character in a variable, $list,
> and a name in the variable $name. If the name appears in the list, I want to
> remove it and clean up $list. It takes me 4 calls to s///, and it looks
> clunky. I have a feeling that some
Hi, Mark, :)
On Wed, 11 Dec 2002 [EMAIL PROTECTED] wrote:
> I have a list of names, separated by the '/' character in a
> variable, $list, and a name in the variable $name. If the name
> appears in the list, I want to remove it and clean up $list. It
> takes me 4 calls to s///, and it looks clu
> I apologize for the confusion, that was in response to Frank's suggestion
> that didn't have the leading '/' question-marked.
Sorry...I misunderstood your OP...here is a solution that should work
$list =~ s!(/)?\b$name\b(/)?!$2 ? ($1||'') : ($2||'')!e;
Tanton
--
To unsubscribe, e-mail: [EM
In a message dated 12/11/2002 12:27:41 PM Pacific Standard Time,
[EMAIL PROTECTED] writes:
> > If it's on the front, it won't remove it because it doesn't have a
> preceeding
> > / in that case.
>
> 'm confused...according to your first post:
I apologize for the confusion, that was in response
> If it's on the front, it won't remove it because it doesn't have a
preceeding
> / in that case.
I'm confused...according to your first post:
>$list =~ s|$name||; # remove $name from the list if it's in the list
>$list =~ s|//|/|; # if $name was in the middle of the list, it would have
>left beh
In a message dated 12/11/2002 12:00:43 PM Pacific Standard Time,
[EMAIL PROTECTED] writes:
> How about this:
>
> $list =~ s|/$name||;
> $list =~ s|^/||;
>
> If it's at the end, it will remove the last /.
> If it's in the middle it will fill in correctly.
> If it's
PM
Subject: Re: Removing a name from a list - advanced regexp - TIMTOWTDI
> Forget that...this works in all cases:
>
> $list =~ s|((?!.)/)\b$name\b/?||;
>
> - Original Message -
> From: "Tanton Gibbs" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <
rom a list - advanced regexp - TIMTOWTDI
> > In a message dated 12/11/2002 11:54:48 AM Pacific Standard Time,
> > [EMAIL PROTECTED] writes:
> >
> >
> > > What about just
> > > $list =~ s|/?$name/?||
> >
> > If $name appears in the middle of the list,
> In a message dated 12/11/2002 11:54:48 AM Pacific Standard Time,
> [EMAIL PROTECTED] writes:
>
>
> > What about just
> > $list =~ s|/?$name/?||
>
> If $name appears in the middle of the list, this removes both '/'
characters.
> This was my first guess as well.
Ah, didn't think about that one :)
In a message dated 12/11/2002 11:54:48 AM Pacific Standard Time,
[EMAIL PROTECTED] writes:
> What about just
> $list =~ s|/?$name/?||
If $name appears in the middle of the list, this removes both '/' characters.
This was my first guess as well.
> But you should be careful about that in case
.--[ [EMAIL PROTECTED] wrote (2002/12/11 at 14:49:15) ]--
|
| I have a list of names, separated by the '/' character in a variable,
| $list, and a name in the variable $name. If the name appears in the
| list, I want to remove it and clean up $list. It takes me 4 calls to
|
December 11, 2002 2:49 PM
Subject: Removing a name from a list - advanced regexp - TIMTOWTDI
> I have a list of names, separated by the '/' character in a variable,
$list,
> and a name in the variable $name. If the name appears in the list, I want
to
> remove it and clean up $
I have a list of names, separated by the '/' character in a variable, $list,
and a name in the variable $name. If the name appears in the list, I want to
remove it and clean up $list. It takes me 4 calls to s///, and it looks
clunky. I have a feeling that someone out there on this list will k
On Monday, May 13, 2002, at 10:40 AM, Todd Wade,,,Room 108 wrote:
> Bob Ackerman wrote:
>
>>
>> this one wins the prolix award of the solutions we have seen today.
>> we dare a non-perl programmer to believe this could mean something.
>> I'm not sure i believe it means whatever. especially (?)(
Todd Wade wrote:
>
> John W. Krahn wrote:
>
> > Todd Wade wrote:
> >
> > Why remove everything you don't want, why not just capture the data you
> > do want?
>
> sure
>
> >> $weather =~ tr/[A-Z]\n/[a-z] /;
> > ^ ^ ^ ^
> > Why are you translating a '[' to '[' and ']
Bob Ackerman wrote:
>
> this one wins the prolix award of the solutions we have seen today.
> we dare a non-perl programmer to believe this could mean something.
> I'm not sure i believe it means whatever. especially (?)(.) - zero or one
> character followed by a character?
> followed by a non-
John W. Krahn wrote:
> Todd Wade wrote:
>
> Why remove everything you don't want, why not just capture the data you
> do want?
sure
>
>> $weather =~ tr/[A-Z]\n/[a-z] /;
> ^ ^ ^ ^
> Why are you translating a '[' to '[' and ']' to ']'? Why are you
> translating "\n
Todd Wade wrote:
>
> This sub grabs http://weather.noaa.gov/pub/data/forecasts/zone/oh/ohz021.txt
> with LWP::Simple, extracts the current weather conditions out of the heading
> and future forecast, Lowercases the entire string, uppercases the first word
> in every sentence, and returns the stri
On Sunday, May 12, 2002, at 11:08 PM, Todd Wade wrote:
>
> "JosÈ nyimi" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> The Perl slogan is: "There Is More Than One Way To Do It".
>>
>> I'm interested to see how you will do the small convertion below.
>
> T
"José nyimi" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The Perl slogan is: "There Is More Than One Way To Do It".
>
> I'm interested to see how you will do the small convertion below.
This sub grabs http://weather.noaa.gov/pub/data/forecasts/zone/oh/ohz0
On Sun, May 12, 2002 at 07:14:27PM +0200, José Nyimi wrote:
> I'm interested to see how you will do the small convertion below.
>
> sub convert {
> my($in)=@_;
> $in=~/(.)(.*)/;
> $in=uc($1).lc($2);
> return $in;
> }
>
> The task is simply to upercase the first char of a given string and
>
José nyimi wrote:
>
> Hello All,
Hello,
> The Perl slogan is: "There Is More Than One Way To Do It".
>
> I'm interested to see how you will do the small convertion below.
>
> Here is one of mine: probably not the best one :-).
>
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> my $out=&c
> "jn" == josenyimi <[EMAIL PROTECTED]> writes:
jn> The task is simply to upercase the first char of a given string
jn> and lowercase the rest.
$string = ucfirst lc $string;
Nice try, though. :-)
- Chris.
--
$a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a
Hello All,
The Perl slogan is: "There Is More Than One Way To Do It".
I'm interested to see how you will do the small convertion below.
Here is one of mine: probably not the best one :-).
#!/usr/bin/perl
use strict;
use warnings;
my $out=&convert('abCdE');
print "$out\n";
sub convert {
my(
28 matches
Mail list logo