Hi Folks,
I have a script written which will read a file and analyse the input and
depending on the input i should make different files for the same.
The code is,
###
open(FILE,"< $file_name");
while()
{
$line=$_;
if($line= /(.*)(Unique Column name)(.
I don't know how to use URI::URI to solve my problem after reading the pod doc.
since it is not easy to use regex, I am going to use split '/', $url
to extract the last field.
On 4/26/06, Tom Phoenix <[EMAIL PROTECTED]> wrote:
> On 4/25/06, nishanth ev <[EMAIL PROTECTED]> wrote:
>
> > if( $url =~
if ($url =~ /\/([^\/]*)$/) {
print $1;
}
On 26/04/06, Tom Phoenix <[EMAIL PROTECTED]> wrote:
>
> On 4/25/06, nishanth ev <[EMAIL PROTECTED]> wrote:
>
> > if( $url =~ /\/([\w.]*$)/ ){
> > print $1;
> > }
>
> http://example.com/some-file.txt
>
> > > To process a URL requires more than a
On 4/26/06, Praveena Vittal <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I am newbie of perl joined in this group last month.I could like to
> know how could i develop my perl programming and my opinion is only
> reading the materials , and other documents related to perl does not
> matters.Is ther
On 4/25/06, Jay Savage <[EMAIL PROTECTED]> wrote:
>
> *Don't top post.*
>
> On 4/25/06, Mazhar <[EMAIL PROTECTED]> wrote:
> > Paul,
> >
> > It lists me out the operating system name thanks for the same. How can i
> go
> > about getting the different drives/volumes created on the same...
> >
> > Reg
On 4/25/06, nishanth ev <[EMAIL PROTECTED]> wrote:
> if( $url =~ /\/([\w.]*$)/ ){
> print $1;
> }
http://example.com/some-file.txt
> > To process a URL requires more than a simple pattern
> > match. Use a
> > module from CPAN. Cheers!
What I said.
--Tom Phoenix
Stonehenge Perl Train
Hello,
I tried this and worked.
Please let me know in case you find any bugs in this
:)
$url="http://dev.catalyst.perl.org/wiki/YetAnotherCatalystIntro";;
if( $url =~ /\/([\w.]*$)/ ){
print $1;
}
else{
print "No Match";
}
Regards
Nishanth
--- Tom Phoenix <[EMAIL PROTECTED]> wro
On 4/25/06, John Ackley <[EMAIL PROTECTED]> wrote:
> if( $url =~ /\/(.*$)/ )
>
> then characters after last / are found in $1
Unfortunately, characters after the first slash are in there, too.
To process a URL requires more than a simple pattern match. Use a
module from CPAN. Cheers!
--Tom Phoe
Ken Perl wrote:
If I want to use regular expression to extract the charactors after
the last '/' in the url, but below regexpr doesn't work, what I do
wrong?
$url = 'http://website.com/path/file_name.img';
if (/\/.*$/)
{
print $url."is matched \n";
}
else
{
print "failed";
}
--
perl -e
On 4/25/06, Sanchita Dahal <[EMAIL PROTECTED]> wrote:
> I am getting "501 Protocol scheme 'http' is not supported at test.pl
> line 11." error. Please help.
It sounds as if LWP isn't properly installed. Can you get it to pass
all the tests, and then re-install it? Good luck!
--Tom Phoenix
Stone
On 4/25/06, Ken Perl <[EMAIL PROTECTED]> wrote:
> If I want to use regular expression to extract the charactors after
> the last '/' in the url, but below regexpr doesn't work, what I do
> wrong?
You're not using a module from CPAN. There's one on there that
understands the rules about URLs. How
If I want to use regular expression to extract the charactors after
the last '/' in the url, but below regexpr doesn't work, what I do
wrong?
$url = 'http://website.com/path/file_name.img';
if (/\/.*$/)
{
print $url."is matched \n";
}
else
{
print "failed";
}
--
perl -e 'print unpack(u,"6
On 4/26/06, nishanth ev <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Its not the error with the perl script.
> Your program ran perfect on my machine.
> Please let me know if you ran it as a cgi script after
> adding the shebang and other modifications or simply
> ran as perl script.
Simply as a perl sc
Hi,
I am trying to run this
++
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $response = $ua->get('http://search.cpan.org/');
if ($response->is_success) {
print $response->content; # or whatever
}
else {
die $response->status_line;
}
*
Ryan Perry wrote:
> my $hashref;
> my @num=qw( 0 1 2 3 4 5 );
> @hashref->[EMAIL PROTECTED] = ('one', 'two', 'three', 'four', 'five', 'six');
@{ $hashref [EMAIL PROTECTED] = ('one', 'two', 'three', 'four', 'five', 'six');
> print join("'\t'", keys %{$hashref}), "'\n";
> print join("\t", values %
my $hashref;
my @num=qw( 0 1 2 3 4 5 );
@hashref->[EMAIL PROTECTED] = ('one', 'two', 'three', 'four', 'five', 'six');
print join("'\t'", keys %{$hashref}), "'\n";
print join("\t", values %{$hashref}), "'\n";
How do I properly use hashref slices?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For a
On 4/25/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
> sort {
> $a->value() cmp $b->value()
> ||
> $a->part('Name')->value() cmp $b->part('Name')->value()
> }
> grep { defined } @objects
But sometimes $a->part('Name') returns undef, so the sort fails.
On Tue, 2006-25-04 at 16:41 -0500, JupiterHost.Net wrote:
> althought technically any rm -rf (ven the shell itself) has a race
> condition since it could clean out directory, move on and then, someone
> adds a file between cleaning out the directory and its removal.
Sorry, there is no such race
Jay Savage wrote:
On 4/25/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
for my $obj(
sort {
$a->value() cmp $b->value()
||
$a->part('Name')->value() cmp $b->part('Name')->value()
}
grep { defined } @objects
) {
...
$a/$b->value() always works since if $
Timothy Johnson wrote:
Just a thought, but couldn't you put the logic in your grep statement?
Something like this:
grep {defined($_->value()) or defined($_->part('Name')->value())}
@objects;
The only problem is then that the object woudl be completely skipped.
I need all objects regardles
Brian McKee wrote:
On 25/04/06, RICHARD FERNANDEZ <[EMAIL PROTECTED]> wrote:
Is there a definative way to recreate the gnu `rm -rf` in perl?
You could use rmtree.
perldoc File::Path
Looks good, but then I saw this:
NOTE: There are race conditions internal to the implementation of
On 4/25/06, Paul D. Kraus <[EMAIL PROTECTED]> wrote:
> I am picking up python and messing around with it and I always come running
> back to perl :)
> At any rate I am curious what the more experienced programmers think of the
> language and its uses.
One thing that a lot of people like about Pyth
Hi, everybody!
Has anybody had any problems with using Lingua::Wordnet on Linux? I
have. I can't even open a dictionary.
My script fails creating a Lingua::Wordnet object.
[EMAIL PROTECTED] ~]$ cat test.pl
#!/usr/bin/perl -w -Ilib
use Lingua::Wordnet;
Lingua::Wordnet->new('lib/Lingua/dict');
Hi, list!
Had anybody problems with using Lingua::Wordnet? I have..
I have following simple test script:
test.pl:
001: use Lingua::Wordnet;
002: my $dict = new Lingua::Wordnet('lib/Lingua/dict');
Lingua::Wordnet object creation fails with following error:
Unable to load lib/Lingua/dict/lingu
On 25/04/06, RICHARD FERNANDEZ <[EMAIL PROTECTED]> wrote:
>>
>> Is there a definative way to recreate the gnu `rm -rf` in perl?
>
> You could use rmtree.
>
> perldoc File::Path
Looks good, but then I saw this:
NOTE: There are race conditions internal to the implementation of
"rmtree" making
Just a thought, but couldn't you put the logic in your grep statement?
Something like this:
grep {defined($_->value()) or defined($_->part('Name')->value())}
@objects;
-Original Message-
From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 25, 2006 12:22 PM
To: beginne
Is there a definative way to recreate the gnu `rm -rf` in perl?
I've seen a couple of modules that seem to implement something, and a
bunch of variations using File::Find, but it just seems overly
complicated.Since it's important I understand exactly what it's
going to do (it's removing data
On 4/25/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
> On Tue, 2006-25-04 at 15:37 -0400, Jay Savage wrote:
> > Seriously, though, go easy on the pruning. The rule of tumb is is that
> > the message should include enough information that a person joining
> > the thread can make sense of the re
Is there a definative way to recreate the gnu `rm -rf` in perl?
I've seen a couple of modules that seem to implement something, and a
bunch of variations using File::Find, but it just seems overly
complicated.Since it's important I understand exactly what it's
going to do (it's removing data
On 4/25/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
> for my $obj(
> sort {
> $a->value() cmp $b->value()
> ||
> $a->part('Name')->value() cmp $b->part('Name')->value()
> }
> grep { defined } @objects
> ) {
>
> ...
>
> $a/$b->value() always works since i
On Tue, 2006-25-04 at 15:37 -0400, Jay Savage wrote:
> Seriously, though, go easy on the pruning. The rule of tumb is is that
> the message should include enough information that a person joining
> the thread can make sense of the response from the response itself.
> Unless the OP is particulalry v
On 4/25/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
> On Tue, 2006-25-04 at 13:38 -0400, Jay Savage wrote:
> > *Don't top post.*
>
> *Prune your posts*
>
> Quote only what is important to your comments. Remove nested quotes
> (unless really, really important).
>
> Change the subject when you
Hello List,
I have a sort() issue that is a bit odd and any input wouls be most
appreciated :)
The code:
use strict;
use warnings;
...
for my $obj(
sort {
$a->value() cmp $b->value()
||
$a->part('Name')->value() cmp $b->part('Name')->value()
}
grep { defi
On Tue, 2006-25-04 at 13:38 -0400, Jay Savage wrote:
> *Don't top post.*
*Prune your posts*
Quote only what is important to your comments. Remove nested quotes
(unless really, really important).
Change the subject when you change the subject.
--
__END__
Just my 0.0002 million dollars wor
*Don't top post.*
On 4/25/06, Mazhar <[EMAIL PROTECTED]> wrote:
> Paul,
>
> It lists me out the operating system name thanks for the same. How can i go
> about getting the different drives/volumes created on the same...
>
> Regards
> Mazhar
>
> On 4/25/06, Paul D. Kraus <[EMAIL PROTECTED]> wrote:
On Tue, 2006-25-04 at 21:09 -0700, Praveena Vittal wrote:
> Hi All,
>
> I am newbie of perl joined in this group last month.I could like to
> know how could i develop my perl programming and my opinion is only
> reading the materials , and other documents related to perl does not
> matters.Is
Hi All,
I am newbie of perl joined in this group last month.I could like to
know how could i develop my perl programming and my opinion is only
reading the materials , and other documents related to perl does not
matters.Is there any other way that makes me better in perl like
certification
On 4/25/06, Monomachus <[EMAIL PROTECTED]> wrote:
> I need a RegEx (!!!with modify(m//)) what matches the words what ends with
> 'a'.
> =
> I have a test_file (for ex.:)
> =
> beforematchafter
> wilma and nana
> Mrs. Wilma Flinstone hommie
>
On Tue, 2006-25-04 at 17:36 +0400, Monomachus wrote:
> #!/usr/bin/perl -w
> use strict;
> my $i=1;
> while (<>) { # take one input line at time
> chomp;
> if (/(\b\w*a\b)/) {
This matches only the first occurrence. You will need a loop to match
them all.
> pri
I need a RegEx (!!!with modify(m//)) what matches the words what ends with 'a'.
=
I have a test_file (for ex.:)
=
beforematchafter
wilma and nana
Mrs. Wilma Flinstone hommie
barney
wilma&fred
wilmafred
flinstone
mama&fred
===
I am picking up python and messing around with it and I always come running
back to perl :)
At any rate I am curious what the more experienced programmers think of the
language and its uses.
Best tool for the best job seems to be the slogan. So my question is what do
people use python for that per
On 4/25/06, Mazhar <[EMAIL PROTECTED]> wrote:
>
> Paul,
>
> It lists me out the operating system name thanks for the same. How can i
> go about getting the different drives/volumes created on the same...
>
> Regards
> Mazhar
>
I am not entirely sure what you are trying to do. Can you give me an ex
Mazhar wrote:
Dear Irfan,
i think for the code you can try the below,
($some_thing1,$some_thing2,$something_3)=split($test,".")
You have the split arguments reversed :)
Also, don't use double quotes when there is nothing to interpolate.
And space them out so its easier to read :)
An
Paul,
It lists me out the operating system name thanks for the same. How can i go
about getting the different drives/volumes created on the same...
Regards
Mazhar
On 4/25/06, Paul D. Kraus <[EMAIL PROTECTED]> wrote:
>
>
>
> On 4/25/06, Mazhar <[EMAIL PROTECTED]> wrote:
> >
> > Hi Folks,
> >
> >
Hi Folks,
I need to develop a script where in i need to first check the type of OS and
then go about in finding the drives.
I need your help in getting an idea of how to start about this...
Thanks in Advance
Regards
Mazhar
Dear Irfan,
i think for the code you can try the below,
($some_thing1,$some_thing2,$something_3)=split($test,".")
Regards
Mazhar
On 4/25/06, Tom Allison <[EMAIL PROTECTED]> wrote:
>
> Irfan J Sayed wrote:
> > Hi,
> >
> > I have a following line/statement stored in variable $test
> >
> > de
"M. Kristall" schreef:
> Ruud:
>> [ while(local $_ = ) ]
>> With while(), the $_ is already local.
>> Wouldn't using that 'local' explicitly, add another local-layer?
>
> my $i = 5;
> $_ = 'Hi there!!!';
> while ($_ = $i--) { print }
> print
> 543210
>
> my $i = 5;
> $_ = 'Hi there!!!';
> while (
Smith, Derek wrote:
I want to use truncate to delete a matched line out a named.conf file on
my DNS box.
Here is my code
As others have said, this will lop off the end of the file.
Another option is to run perl -i and edit the file in place.
while(<>){ print if /Acheck\-names/ }
But under
Irfan J Sayed wrote:
Hi,
I have a following line/statement stored in variable $test
deliver.Admin_Irfan_Project.20060413.212355
i want to split this line in . and store in array.
I am using following code
my @name = Split(/./, $test);
split uses regular expressions to identify where to spl
49 matches
Mail list logo