String manipulation help needed

2002-02-14 Thread Brian Johnson

I need a string in the form
Wed, 18 Jul 2001 14:20

Of course my line doesn't quite cut it.
  my $emaildate = join " ", $record->{day}, $record->{month},
$record->{year}, $record->{hour}, $record->{minute};

I'm weak in string manipulation in perl - any help people?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: String manipulation help needed

2002-02-14 Thread Brett W. McCoy

On Thu, 14 Feb 2002, Brian Johnson wrote:

> I need a string in the form
> Wed, 18 Jul 2001 14:20
>
> Of course my line doesn't quite cut it.
>   my $emaildate = join " ", $record->{day}, $record->{month},
> $record->{year}, $record->{hour}, $record->{minute};

Just interpolate the variables directly inside double quotes:

my $emaildate = "$record->{day}, $record->{month} $record->{year}
$record->{hour}:$record->{minute}";

-- Brett
  http://www.chapelperilous.net/

When a lot of remedies are suggested for a disease, that means it can't
be cured.
-- Anton Chekhov, "The Cherry Orchard"


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: String manipulation help needed

2002-02-15 Thread Andrea Holstein

In article <[EMAIL PROTECTED]> wrote "Brett 
W. McCoy"
<[EMAIL PROTECTED]>:

> On Thu, 14 Feb 2002, Brian Johnson wrote:
> 
>> I need a string in the form
>> Wed, 18 Jul 2001 14:20
>>
>> Of course my line doesn't quite cut it.
>>   my $emaildate = join " ", $record->{day}, $record->{month},
>> $record->{year}, $record->{hour}, $record->{minute};
> 
> Just interpolate the variables directly inside double quotes:
> 
> my $emaildate = "$record->{day}, $record->{month} $record->{year}
> $record->{hour}:$record->{minute}";
> 
Or if you like it a little bit shorter:

my $emaildate = "$_->{day}, $_->{month} $_->{year} $_->{hour}:$_->{minute}" for 
($record);

Greetings,
Andrea

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]