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

Re: [PBML] string creations problem-Need answer please

Expand Messages
  • Luinrandir Hernsen
    As you can tell.. there are many things about programming technique I lack that you have ever so kindly imparted to me.. I truly thank you for the direction
    Message 1 of 7 , Aug 30, 2004
    • 0 Attachment
      As you can tell.. there are many things about programming technique I lack that you have ever so kindly imparted to me.. I truly thank you for the direction you have given me. many Many thanks.

      Lou Hernsen
      ----- Original Message -----
      From: Jenda Krynicky
      To: perl-beginner@yahoogroups.com
      Sent: Monday, August 30, 2004 1:22 PM
      Subject: Re: [PBML] string creations problem-Need answer please


      From: "Luinrandir Hernsen" <Luinrandir@...>
      > I am trying to create this string for writeing to a data file.
      > In my editor i have everything on several lines:
      >
      > $DataLine="$Avalon,$Armagh,$Abbeyfeale,$Athlone,$Arklow,$Ardara,$Ant
      > rim,$Bangor, ...


      $DataLine = join( ',', $Avalon, $Armagh, $Abbeyfeale, $Athlone,
      $Arklow, $Ardara, $Antrim, $Bangor, ... );

      You should really use some data structure instead of this huge list
      of variables. If you did use a hash ($data{Avalon} instead of
      $Avalon) then this printing would be just

      $DataLine = join( ',', map $data{$_}, sort keys %data);

      > Also ... can I write a @DataLine to a file?

      It's $DataLine, not @DataLine !

      > print <@DataLine>

      open my $FH, '>', 'path/to/the/file'
      or die "Can't create the file: $!\n";
      ...
      print $FH $DataLine;
      ...
      close $FH;


      Jenda
      ===== Jenda@... === http://Jenda.Krynicky.cz =====
      When it comes to wine, women and song, wizards are allowed
      to get drunk and croon as much as they like.
      -- Terry Pratchett in Sourcery



      Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html


      Yahoo! Groups Sponsor
      ADVERTISEMENT





      ------------------------------------------------------------------------------
      Yahoo! Groups Links

      a.. To visit your group on the web, go to:
      http://groups.yahoo.com/group/perl-beginner/

      b.. To unsubscribe from this group, send an email to:
      perl-beginner-unsubscribe@yahoogroups.com

      c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.