Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Search and Translate functions?

Expand Messages
  • vakeel ahmad
    you can use associative arrays for this. vakeel. ... __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online,
    Message 1 of 3 , Apr 3, 2003
    • 0 Attachment
      you can use associative arrays for this.

      vakeel.


      --- zeshanism <zeshanism@...> wrote:
      > I have a date from the form in format: 2003-04-03,
      > (yyyy-mm-dd).
      >
      > $date = $field{'date'} ;
      >
      > but once after input I want to format it through
      > script as:
      >
      > Apr-04-03 (Name of Month - day remains same - Year
      > in two digits)
      >
      > Is it possible?
      >
      > Thanks,
      >
      > Zeshan.
      >
      >
      >

      __________________________________________________
      Do you Yahoo!?
      Yahoo! Tax Center - File online, calculators, forms, and more
      http://tax.yahoo.com
    • Damien Carbery
      ... Should this be: Apr-03-03 To be clearer: I believe you want to change 2003-11-18 to Nov-18- 03 This untested regular expression might work: my @Months
      Message 2 of 3 , Apr 4, 2003
      • 0 Attachment
        --- In perl-beginner@yahoogroups.com, "zeshanism" <zeshanism@y...>
        wrote:
        > I have a date from the form in format: 2003-04-03, (yyyy-mm-dd).
        >
        > $date = $field{'date'} ;
        >
        > but once after input I want to format it through script as:
        >
        > Apr-04-03 (Name of Month - day remains same - Year in two digits)
        >
        > Is it possible?
        >
        > Thanks,
        >
        > Zeshan.

        > Apr-04-03 (Name of Month - day remains same - Year in two digits)
        Should this be: Apr-03-03
        To be clearer: I believe you want to change '2003-11-18' to 'Nov-18-
        03'

        This untested regular expression might work:
        my @Months = qw( Jan Feb Mar Apr etc );
        $date ~= s/^\d{2}(\d{2})-(\d{2})-(\d{2})$/$Months[$2]-$3-$1/e;
      Your message has been successfully submitted and would be delivered to recipients shortly.