Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Adding Strings to an Array Permanently

by OxYgEn (Acolyte)
on Mar 02, 2004 at 00:33 UTC ( #333120=note: print w/replies, xml ) Need Help??


in reply to Re: Adding Strings to an Array Permanently
in thread Adding Strings to an Array Permanently

Uh, this is a bit embarrasing, but...
I'm very new to perl. I don't think you can be much newer than me. Could you give me some little snippet of code with an example of what you're saying, Roger?

Thanks again,
OxYgEn
  • Comment on Re: Re: Adding Strings to an Array Permanently

Replies are listed 'Best First'.
Re: Re: Re: Adding Strings to an Array Permanently
by Roger (Parson) on Mar 02, 2004 at 00:55 UTC
    #!/usr/bin/perl -w use strict; use IO::File; use Data::Serializer; use Data::Dumper; my @list; my $s = Data::Serializer->new( serializer => 'Storable', portable => 0, compress => 0, ); if (-s "./list.bin") { print "Load ice and thaw\n"; my $f = new IO::File "./list.bin", "r" or die; my $ice = do { local $/; <$f> }; @list = @{$s->thaw($ice)}; print Dumper(\@list); } else { print "Build list and freeze\n"; @list = qw/ 0 1 2 3 /; my $ice = $s->freeze(\@list); my $f = new IO::File "./list.bin", "w" or die; print $f $ice; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://333120]
help
Chatterbox?
[Lady_Aleena]: shmem, geany on Debian jessie.
[shmem]: some experience with vim?
[Lady_Aleena]: None
[shmem]: I don't know geany, and don't know whether it has support for ctags.
[Lady_Aleena]: ctags?
[shmem]: ctags is a program which (recursively) extracts the symbols from source and stores them in a one-file database. This allows you to query the locations where these symbols (e.g. a subroutine name) are used anywhere in the source code tree...
[shmem]: ...from inside the editor.
[shmem]: apt-get install exuberant-ctags
[Lady_Aleena]: I think I heard vim has a big learning curve.
[shmem]: then in the root of your source tree run: ctags -R

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-04-27 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (505 votes). Check out past polls.