jack jack wrote:
> Hi All,

Hi. Use a meaningful subject. "perl help" is a given on this list.

> 
> 
>  I have 2 variables $last_accessed and $owner_line
> $last_accessed=": Last accessed 20-Apr-04.12:57:30 by
> [EMAIL PROTECTED]";
> $owner_line="Owner: opc_bld          : rwx (all)";
> 
> -From $last_accessed i want the foll output in variables :
> $view_day=20
> $view_month=Apr
> $view_year=04
> 
> -From $owner_line i want the foll output in varia:
> $owner=opc_bld
> How should i split $last_accessed and $owner_line

I would use a regex to capture those instead of using split().

> 
> What i want to do after getting the date,month and year , is compare
> it with todays date,
> if the difference is greater then 30 days then do XX,how should i
> implement in perl.

I would get the date as a single string and pass it to Date::Manip's
ParseDate function, which can understand that format. Then I would use the
same module's DateCalc function to determine the delta from today's date.

Other folks might recommend the DateTime family of modules, but I'm just
starting to learn those myself...

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to