S Mathias wrote:
> cat asdf.txt
> bla-bla
> bla-bla
> bla[XYZ]
> importantthing
> another important thing
> [/XYZ]
> bla-bla
> bla-bla
> [XYZ]
> yet another thing
> hello!
> [/XYZ]
> bla-bla
> etc.
> $ SOMEPERLMAGIC asdf.txt > output.txt
> $ cat output.txt
> importantthing
> another important thin
On Tue, Jan 4, 2011 at 11:40 AM, Joao Ferreira gmail
wrote:
> On Tue, 2011-01-04 at 02:27 -0800, S Mathias wrote:
>> cat asdf.txt
>> bla-bla
>> bla-bla
>> bla[XYZ]
>> importantthing
>> another important thing
>> [/XYZ]
>> bla-bla
>> bla-bla
>> [XYZ]
>> yet another thing
>> hello!
>> [/XYZ]
>> bla-
On Tue, 2011-01-04 at 02:27 -0800, S Mathias wrote:
> cat asdf.txt
> bla-bla
> bla-bla
> bla[XYZ]
> importantthing
> another important thing
> [/XYZ]
> bla-bla
> bla-bla
> [XYZ]
> yet another thing
> hello!
> [/XYZ]
> bla-bla
> etc.
> $ SOMEPERLMAGIC asdf.txt > output.txt
> $ cat output.txt
> impor
cat asdf.txt
bla-bla
bla-bla
bla[XYZ]
importantthing
another important thing
[/XYZ]
bla-bla
bla-bla
[XYZ]
yet another thing
hello!
[/XYZ]
bla-bla
etc.
$ SOMEPERLMAGIC asdf.txt > output.txt
$ cat output.txt
importantthing
another important thing
yet another thing
hello!
how can i sovle this questi
The solution [from the FreeBSD mailing list]:
perl -00 -e 'print map $_->[0], sort { $a->[1] <=> $b->[1] } map [$_,
tr/\n//], <>' < before.txt > after.txt
Thank you!!
> or maybe in bash..
> script/"one liner" e.g.: input: http://pastebin.com/raw.php?i=pMZPEsMZ
>
> i want to make this output fro
wow, thanks!!
and how exactly can i use this magic?
http://pastebin.com/raw.php?i=XZ1rn2bM
sorry for the dumb question:\
Thank you!
> Jozsi Vadkan wrote:
>
> > or maybe in bash..
> > script/"one liner" e.g.: input: http://pastebin.com/raw.php?i=pMZPEsMZ
> >
> > i want to make this output fr
Jozsi Vadkan wrote:
or maybe in bash..
script/"one liner" e.g.: input: http://pastebin.com/raw.php?i=pMZPEsMZ
i want to make this output from it:
http://pastebin.com/raw.php?i=kH8VxT0A
So from the input, i want to make an ascendant order, how many things
are under a "SOMETHING-XX"
Does anyon
or maybe in bash..
script/"one liner" e.g.: input: http://pastebin.com/raw.php?i=pMZPEsMZ
i want to make this output from it:
http://pastebin.com/raw.php?i=kH8VxT0A
So from the input, i want to make an ascendant order, how many things
are under a "SOMETHING-XX"
Does anyone has any "perl magic"
On Sat, Dec 19, 2009 at 11:00:07AM -0500, Chris Dale wrote:
> On Sat, 19 Dec 2009, Alex Samad wrote:
> > I have a set of constants setup in my script
> >
> > RC_OK
> > ...
> > ...
> >
> > I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
> > redifinition
> >
> > is there some wa
On Sat, 19 Dec 2009, Alex Samad wrote:
> I have a set of constants setup in my script
>
> RC_OK
> ...
> ...
>
> I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
> redifinition
>
> is there some way around this with out renaming my constants.
You can suppress symbol importing,
How about setting it a "local" variable?
And I think that you'd better send such a question to a perl mailing list.
Alex Samad wrote:
> Hi
>
> I have a set of constants setup in my script
>
> RC_OK
> ...
> ...
>
> I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
> redifinition
>
Hi,
did you check this issue on Perl sites? Try to start with
www.cpan.org. BTW this is a very great site.
Good luck,
Gabor
2009/12/19 Alex Samad :
> Hi
>
> I have a set of constants setup in my script
>
> RC_OK
> ...
> ...
>
> I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
>
Hi
I have a set of constants setup in my script
RC_OK
...
...
I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
redifinition
is there some way around this with out renaming my constants.
Alex
signature.asc
Description: Digital signature
On Thu, Apr 01, 2004 at 02:10:46PM -0800, William Ballard wrote:
> Given:
>
> A - 1
> A - 2
> B - 1
> B - 2
>
> what's the simplest command or perl script to print it as:
>
> A (1, 2)
> B (1, 2)
>
> or something equivalent.
Hmm, one of the zillions of ways of doing something equivalent, with t
Moin,
* William Ballard wrote (2004-04-02 00:10):
>Given:
>
>A - 1
>A - 2
>B - 1
>B - 2
>
>what's the simplest command or perl script to print it as:
>
>A (1, 2)
>B (1, 2)
>
>or something equivalent.
Is that an array? Depending on the size and whether it's fixed I would
use either printf or somet
Given:
A - 1
A - 2
B - 1
B - 2
what's the simplest command or perl script to print it as:
A (1, 2)
B (1, 2)
or something equivalent.
Thanks
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
>> Do not reinvent wheel :). Use standart Perl modules.
>>
>> use File::Path;
>> rmtree([$dir]);
>>
>> See File::Path docs for more info.
>>
KGM> Correct me if I'm wrong, but this is what the OP *didn't* want to do
KGM> (taken from File::Path doc):
KGM> "All of the files and directories
KGM
Ilya Martynov wrote:
>
> >> > Here's one for some of the perl guys
> >> >
> >> > I want to delete a directory that will have files in it...
> >> > I don't know the name of the files there for wildcards might
> >> > be needed
> >> >
> >> > I understand that "rmdir" will wipe out an empt
>> > Here's one for some of the perl guys
>> >
>> > I want to delete a directory that will have files in it...
>> > I don't know the name of the files there for wildcards might
>> > be needed
>> >
>> > I understand that "rmdir" will wipe out an empty directory
>> > and "unlink" wil
> >From: "Mike Egglestone"<[EMAIL PROTECTED]>
> >To: "debian-user"
> >Subject: perl question
> >Date: Thu, Jul 18, 2002, 4:53 AM
> >
>
> > Hello...
> >
> > Here's one for some of the perl guys
> >
> &g
--- Mike Egglestone <[EMAIL PROTECTED]>
wrote:
> thanks for all the inputs !!!
Just condensing all the answers given
(more for myself)
>I'm really new to Perl and I'm guessing that
>I can't run shell commands within a perl script...
Check out system() and exec()...
thanks for all the inputs !!!
I ended up using the rmtree command...
I needed to execute this in Perl
because I have a web based emailer written in Perl...
One part of the program will create an upload directory for the
user ... however... I couldn't get a quota on it so I just delete
the
On Tue, 17 Jul 2001, Craig Dickson wrote:
> > What would be a nice command to remove a dirtory that had files in it?
> rm -rf directory
But if you don't want to spawn a sh.
Check all this as it is off the cuff and I would usually
use backticks or system to do this type of thing.
#!/usr/bin/per
Mike's Question:
I want to delete a directory that will have files in
it...I don't know the name of the files there for
wildcards might be needed
I understand that "rmdir" will wipe out an empty
directoryand "unlink" will wipe out files (only if
I know the names of the files)
Wha
Simply Speaking, This would have been done better with these
shell commands:
# cd /directory
# rm -rf *
# cd ..;
:)
rgrds,
Calvin "Lamer"
--
>From: "Mike Egglestone"<[EMAIL PROTECTED]>
>To: "debian-user"
>Subject: perl question
>Date: Thu
On Wed, Jul 17, 2002 at 04:53:50PM -0400, Mike Egglestone wrote:
> What would be a nice command to remove a dirtory that had files in it?
> Even better what would be a nice command to delete all files
> in one directory... (leaving the directory intact)
#!/usr/bin/perl -w
use File::Path;
rmtre
On Wednesday 17 July 2002 03:53 pm, Mike Egglestone wrote:
> Hello...
>
> Here's one for some of the perl guys
>
> I want to delete a directory that will have files in it...
> I don't know the name of the files there for wildcards might
> be needed
>
> I understand that "rmdir" will wip
Mike Egglestone wrote:
> What would be a nice command to remove a dirtory that had files in it?
rm -rf directory
> Even better what would be a nice command to delete all files
> in one directory... (leaving the directory intact)
rm -rf directory/*
which will delete everything in a director
Hello...
Here's one for some of the perl guys
I want to delete a directory that will have files in it...
I don't know the name of the files there for wildcards might
be needed
I understand that "rmdir" will wipe out an empty directory
and "unlink" will wipe out files (only if I
libwww-perl supports ssl out of the box _kinda_ if Crypt::SSLeay is
installed (or so the readme would have me believe). I dug around in
dselect a bit and find only Net::SSLeay (which the doc says is better,
but not compatible).
The question is if anyone out there knows how to set debian packages
u
david sowerby <[EMAIL PROTECTED]> wrote:
>Hi, can anyone tell me why there are perl5 binaries and perl-5 binaries in
>/usr/bin ? Whats the differemce ?
None: they're hard links to each other, provided for convenience.
[EMAIL PROTECTED] ~]$ ls -i1 /usr/bin/perl{-5.005,5*}
2275 /usr/bin/perl-5.0
Hi, can anyone tell me why there are perl5 binaries and perl-5 binaries in
/usr/bin ? Whats the differemce ? -david
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Remember, you are unique ... just like everyone else.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Jonathan Lupa wrote:
>
> Is there a built in command, or shell command to retrieve the process
> name from a pid?
>
> The best I could come up with is slurping the stuff from /proc/cmdline
> or something like ps|cut, but it seems to me there is probably a
> better way I am ignorant of.
>
I wonde
On Tue, Feb 29, 2000 at 03:42:20AM +, Colin Watson wrote:
> [EMAIL PROTECTED] (William T Wilson) wrote:
> >ps ax | awk '$1 == {print $5}'
>
> Or indeed 'ps -o%c h -p '.
Thanks guys! :)
--
[EMAIL PROTECTED]
GPG public key available from http://www.jamdata.net/~jjlupa/gpg.asc
pgp5px2HKSc
[EMAIL PROTECTED] (William T Wilson) wrote:
>On Mon, 28 Feb 2000, Jonathan Lupa wrote:
>> Is there a built in command, or shell command to retrieve the process
>> name from a pid?
>
>ps ax | awk '$1 == {print $5}'
Or indeed 'ps -o%c h -p '. This will probably break on other
Unices (and older vers
On Mon, 28 Feb 2000, Jonathan Lupa wrote:
> Is there a built in command, or shell command to retrieve the process
> name from a pid?
ps ax | awk '$1 == {print $5}'
There's no builtin command to do this. I don't know if Perl can do it or
not. I doubt it, though.
> The best I could come up wit
Is there a built in command, or shell command to retrieve the process
name from a pid?
The best I could come up with is slurping the stuff from /proc/cmdline
or something like ps|cut, but it seems to me there is probably a
better way I am ignorant of.
Thanks!
Jonathan
--
[EMAIL PROTECTED]
GPG p
What you'all don't count from zero? Okay, add one then...
--
++
| Eric G. Milleregm2@jps.net |
| GnuPG public key: http://www.jps.net/egm2/gpg.asc |
++
On Sun, 24 Oct 1999, Eric G . Miller wrote:
> For a count of elements in an array
>
> $count = $#array;
^
this is the subscript of the last element in array, one less than
the length, since there is a 0th element;
$count++; # number of elements in array @array;
you could als
For a count of elements in an array
$count = $#array;
--
++
| Eric G. Milleregm2@jps.net |
| GnuPG public key: http://www.jps.net/egm2/gpg.asc |
++
-BEGIN PGP SIGNED MESSAGE-
On Mon, 25 Oct 1999, Olaf Conradi wrote:
> Use of implicit split to @_ is deprecated at ./dialog.pl line 34.
>
> $message_len = split(/^/, $message);# <-- line 34
split always splits to an array. Here, you're trying to get the number of
elements ge
Olaf Conradi ([EMAIL PROTECTED]) wrote:
> Use of implicit split to @_ is deprecated at ./dialog.pl line 34.
> $message_len = split(/^/, $message);# <-- line 34
Split normally returns an array, not a scalar... unless I'm missing something.
(I'm no perl guru.)
--
Greg Wooledge
Hello,
I'm new to perl and want to write a small perl script with a nice
userinterface. There is a wrapperscript for /usr/bin/dialog,
but it gives the following warning:
Use of implicit split to @_ is deprecated at ./dialog.pl line 34.
I'm using potato with perl-5.005.
What is the correct synta
Quoting Manoj Srivastava ([EMAIL PROTECTED]):
> Hi,
> >>"Joey" == Joey Hess <[EMAIL PROTECTED]> writes:
>
> >> The following works under more shells (and also is a man page ;-)
> #!/usr/bin/perl -- # -*- Mode: Perl -*- #
> 'di';
> 'ig00';
>
> "true" || eval 'exec perl -S $0 $argv:q';
> eval
Hi,
>>"Joey" == Joey Hess <[EMAIL PROTECTED]> writes:
>> The following works under more shells (and also is a man page ;-)
#!/usr/bin/perl -- # -*- Mode: Perl -*- #
'di';
'ig00';
"true" || eval 'exec perl -S $0 $argv:q';
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec
Manoj Srivastava wrote:
> Joey> eval 'exec perl -S $0 ${1+"$@"}'
> Joey> if 0;
>
> The following works under more shells (and also is a man page ;-)
> #!/usr/bin/perl -- # -*- Mode: Perl -*- #
Yes, but it doesn't address the orginial problem: It will fail if perl is
no
Hi,
>>"Joey" == Joey Hess <[EMAIL PROTECTED]> writes:
Joey> eval 'exec perl -S $0 ${1+"$@"}'
Joey> if 0;
The following works under more shells (and also is a man page ;-)
I used to use this as a template perl script with built in man page
(this was before we had POD an
On 3 Sep, Hans van den Boogert wrote:
> I'm trying to learn some Perl. I found an on-line book which is Unix
> biased, but the scripts all start with #!/usr/local/bin/perl (which makes
> sense if you have compiled and installed it yourself). However, on my
> Debian system Perl was of course put i
Brad writes:
> One solution would be to write a makefile that detects the location
> of the perl binary and then prepends the proper shebang line to the
> beginning of your perl programs.
Another trick is this:
#! /usr/bin/env perl
print "Hello, world\n";
This depends on env being in /u
* Hans van den Boogert <[EMAIL PROTECTED]> writes:
> I'm trying to learn some Perl. I found an on-line book which is Unix
> biased, but the scripts all start with #!/usr/local/bin/perl (which makes
> sense if you have compiled and installed it yourself). However, on my
> Debian system Perl was of
Hans van den Boogert wrote:
> I'm trying to learn some Perl. I found an on-line book which is Unix
> biased, but the scripts all start with #!/usr/local/bin/perl (which makes
> sense if you have compiled and installed it yourself). However, on my
> Debian system Perl was of course put in /usr/bin/p
-BEGIN PGP SIGNED MESSAGE-
On Thu, 2 Sep 1999, Brian Servis wrote:
> *- On 2 Sep, Jonathan Markevich wrote about "Re: #!/Perl question"
> > On Fri, Sep 03, 1999 at 03:04:49AM +0800, Hans van den Boogert wrote:
> >> I'm trying to learn some Perl. I fo
*- On 2 Sep, Jonathan Markevich wrote about "Re: #!/Perl question"
> On Fri, Sep 03, 1999 at 03:04:49AM +0800, Hans van den Boogert wrote:
>> I'm trying to learn some Perl. I found an on-line book which is Unix
>> biased, but the scripts all start with #!/usr/local/
On Fri, Sep 03, 1999 at 03:04:49AM +0800, Hans van den Boogert wrote:
> I'm trying to learn some Perl. I found an on-line book which is Unix
> biased, but the scripts all start with #!/usr/local/bin/perl (which makes
> sense if you have compiled and installed it yourself). However, on my
> Debian s
I'm trying to learn some Perl. I found an on-line book which is Unix
biased, but the scripts all start with #!/usr/local/bin/perl (which makes
sense if you have compiled and installed it yourself). However, on my
Debian system Perl was of course put in /usr/bin/perl. So how can I write a
Perl scrip
Hi,
I want to use perl to display a list a directories in the tree
format, so that I can display them on the web. What is the best
way to do it. Later on, I want to make the users be able to click on
these tree nodes and to be able to set the permission
on each directory.
Thanks for any he
dave oswald <[EMAIL PROTECTED]> writes:
>
> Normally I would consult with my reference books but am not able to
> get to them.
Or you could just try it! :)
>I thought maybe something like:
>
>$CurrentTime=exec`date "+%D %T"`;
>print $CurrentTime;
>
% perl -e '$CurrentTime = `date "+%D
> I thought maybe something like:
>
> $CurrentTime=exec`date "+%D %T"`;
> print $CurrentTime;
>
$CurrentTime=localtime(time);
Alex Y.
--
_
_( )_
( (o___ +---+
| _ 7 |Alexander Yukhimets|
\(
In a perl script i need to load a variable ($CurrentTime) with the
systems current time. Normally I would consult with my reference books
but am not able to get to them. I find myself using them when I need to
work in perl which is not very often...
I'm looking for time_stamp something like "07/17/
Hi,
Yes, "require 'blah.pl';" is correct. You may also want to
look at .pm files and the new "use blah;" directives.
manoj
use Module LIST
use Module
use Module VERSION LIST
use VERSION
Imports some semantics into the current package
Hi,
Could someone please confirm whether the answer I gave below to a friend
about perl is correct?
Thanks,
Mark.
-- Forwarded message --
Date: Thu, 2 Apr 1998 10:49:30 +0930 (CST)
From: Mark Phillips <[EMAIL PROTECTED]>
To: Bill Moran <[EMAIL PROTECTED]>
Subject: Perl
Dear B
> perldoc perlsec is your friend! :)
>
> Bottom line is that globs are *always* tainted, as is anything that
> relies on shell processing (csh being how globbing is done).
Yep, I realise this, but what I didn't have is an alternative. There's
lots of info on de-tainting user input, but basicall
> I don't "know" the answer to this question, but in your shoes I'd start by
> re-writing the above as:
That (with a couple typo's fixed :) does the trick beautifully! Thanks
for the pointer, I figured there had to be a way to do it.
Adam.
Internet Alaska
Adam Shand wrote:
> How do I untaint the glob, or better yet access it so that it's not
> tainted to start with (if that's possible)? The files I'm accessing are
> safe as only root can write to them, but I'd like to do this the 'right
> way'.
>
> I can't find anything relevant to this in the docs
Howdy...
Sorry for this stupid question but I'm hoping someone can shed some light,
and I'm a 'Perl Beginner'... I'm writing a suid perl script which needs
to search through a whole bunch of files in a directory and return some
information. It all works fine except that the tainting doesn't li
65 matches
Mail list logo