Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Use a Serialized Hash... When It Might Not Exist?

by tybalt89 (Monsignor)
on Nov 12, 2022 at 05:40 UTC ( [id://11148155]=note: print w/replies, xml ) Need Help??


in reply to Use a Serialized Hash... When It Might Not Exist?

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11148149 use warnings; use Storable; my $filename = '/tmp/d.11148149.testfile'; my $hashref = eval { retrieve $filename } || {}; use Data::Dump 'dd'; dd $hashref; # was $hashref->{+time} = 1; # do something with $hashref... use Data::Dump 'dd'; dd $hashref; # is now store $hashref, $filename;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11148155]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-23 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found