On Tue, 28 Jan 2003, Phil Pereira wrote:
Is there an easy way to split 123456 into 12-34-56?
I've been splitting with a basic // into an array, and then printing 2
array elements at a time, sorta like: $array[0] . $array[1]
Golf solutions aside (where people try and solve it in the fewest
From: Mark Fowler [EMAIL PROTECTED]
Date: 1/29/03 10:21:18 AM
Another way is to use a loop with a regular expression to
match two chars with the funky 'g' option to tell it to
match each loop starting from where it left off at the end
of the previous loop (so it moves slowly along the
Mark Fowler wrote:
The last one I can think of (though there will be many more) is to use the
unpack operator. This is somewhat like a regular expression where you
define a template that the string will be broken up into.
my @array = unpack (A2)*, $input;
This uses a simple template. 'A'
Oops, I forgot to post this to the list, but I see it has made
it to the website anyway ;-)
http://www.astray.com/coremodules/
Leon
--
Leon Brocard.http://www.astray.com/
scribot.http://www.scribot.com/
... The worst thing about
On Wed, 29 Jan 2003, Dave Cross wrote:
And that can be simplified to
my @array = $input =~ /(..)/g;
And that can be simplified in turn to
my $output = join '-', $input =~ /(..)/g;
As operators can give each other list context, which is a whole other
conversation (one that's in Chapter 3.8
Mark Fowler said:
On Wed, 29 Jan 2003, Dave Cross wrote:
And that can be simplified to
my @array = $input =~ /(..)/g;
And that can be simplified in turn to
my $output = join '-', $input =~ /(..)/g;
And that can be simplified in turn to
my $output = join '-', $input =~ /../g;
Which is
On Wed, 29 Jan 2003, Paul Makepeace wrote:
So there are a bunch of things order by rank. I'd like to implement a
move up/down in SQL. So say the target was id=20 moving up, I'd like its
rank to become 1, and id=10's rank to become 2.
$query = UPDATE fw SET
On Wed, Jan 29, 2003 at 12:49:40AM +0100, Paul Johnson wrote:
On Tue, Jan 28, 2003 at 11:35:29PM +, Paul Makepeace wrote:
On Tue, Jan 28, 2003 at 11:22:48PM +, Phil Pereira wrote:
Is there an easy way to split 123456 into 12-34-56?
$ perl -lne 'print $1-$2-$3 if
On Wed, Jan 29, 2003 at 01:31:32PM +, David Cantrell wrote:
On Wed, Jan 29, 2003 at 12:49:40AM +0100, Paul Johnson wrote:
On Tue, Jan 28, 2003 at 11:35:29PM +, Paul Makepeace wrote:
On Tue, Jan 28, 2003 at 11:22:48PM +, Phil Pereira wrote:
Is there an easy way to split 123456
On Wed, Jan 29, 2003 at 02:16:58AM +, Paul Makepeace wrote:
I'd like to switch the values of a field in two rows.
1-2 while 2-1, say.
I have a table containing:
= select * from pageplans order by rank;
id | parent | child | rank | loopable | required
On Wed, Jan 29, 2003 at 02:12:43PM +, Martin Bower wrote:
Hi,
I'm using the Image::Info module to return Exif information located inside
images.
image_info() returns a reference to a hash, so the code below returns all
keys and dumps their values.
This works fine, except some keys
Hi,
I'm using the Image::Info module to return Exif information located inside
images.
image_info() returns a reference to a hash, so the code below returns all
keys and dumps their values.
This works fine, except some keys return a reference to an array.
Any ideas on how I can indentify a
On Wed, Jan 29, 2003 at 02:12:43PM +, Martin Bower wrote:
This works fine, except some keys return a reference to an array.
Any ideas on how I can indentify a reference to an array so I can deal with
it accordingly ?
You want the ref() function.
e.g
foreach my $key (keys
Thanks Joel/Leo
Martin
_
Express yourself with cool emoticons http://messenger.msn.co.uk
http://www.sci-fi-london.com/programme.htm
Some interesting stuff here:
* 'Solaris' on the big screen on Saturday
* A PKD documentary
* Westworld/Soylent Green double bill on Sunday
--
David Cantrell|Reprobate|http://www.cantrell.org.uk/david
There is no sigmonster
Just read it and weap.
http://www.datapower.com/products/xa35.html
Ben
On Wed, Jan 29, 2003 at 01:48:04PM +, David Cantrell wrote:
On Wed, Jan 29, 2003 at 02:16:58AM +, Paul Makepeace wrote:
I'd like to switch the values of a field in two rows.
1-2 while 2-1, say.
I have a table containing:
= select * from pageplans order by rank;
id |
Anyone think it would be nice is Sys::Hostname did this itself?
$ perl -MSys::Hostname -le 'print join ., unpack C*, (gethostbyname hostname)[4]'
195.82.114.220
$
perlfaq9, consulted belatedly, (requires Socket)
$ perl -MSocket -MSys::Hostname -le 'print inet_ntoa(scalar gethostbyname
On Wed, Jan 29, 2003 at 12:10:38PM +, the hatter wrote:
On Wed, 29 Jan 2003, Paul Makepeace wrote:
So there are a bunch of things order by rank. I'd like to implement a
move up/down in SQL. So say the target was id=20 moving up, I'd like its
rank to become 1, and id=10's rank to
Not wanting to be awkward or anything, but ...
Paul Makepeace wrote:
On Wed, Jan 29, 2003 at 12:10:38PM +, the hatter wrote:
On Wed, 29 Jan 2003, Paul Makepeace wrote:
So there are a bunch of things order by rank. I'd like to implement a
move up/down in SQL. So say the target was
On Thu, Jan 30, 2003 at 12:13:04AM +, Paul Makepeace wrote:
On Wed, Jan 29, 2003 at 12:10:38PM +, the hatter wrote:
On Wed, 29 Jan 2003, Paul Makepeace wrote:
So there are a bunch of things order by rank. I'd like to implement a
move up/down in SQL. So say the target was id=20
21 matches
Mail list logo