tie Questions

3

Solved

I was trying to tie an hash (or hashref) in order of tracking variable usages. Everything is working for simple cases, but when I tried to use my module on some real code I had this error: hash- ...
Kentiga asked 16/11, 2015 at 15:26

1

I want to see every place when variable in perl script is created/accessed/destroyed It is easily reachable using tie or Variable::Magic But how to apply this magic automatically when variable is...
Twotime asked 24/2, 2017 at 8:39

2

Solved

I want to do something like the following: //std::vector<std::pair<TypeA, TypeB>> someInitializingFunction(); { TypeA a; TypeB b; for (std::tie(a, b) : someInitializingFunction()) ...
Telekinesis asked 23/1, 2014 at 5:50

1

I noticed that with variables declared with the Readonly module, evaluating a variable multiple times can yield different results. >perl -Mbigint -MReadonly -wE "Readonly my $V => 1; foreach...
Immediacy asked 17/1, 2014 at 12:5

1

Solved

Say there are two functions: void ff( const std::tuple<const int&> ) { } template < typename TT > void gg( const std::tuple<const TT&> ) { } and calls to these functio...
Bo asked 13/8, 2013 at 15:35

2

Solved

Similar to the way AUTOLOAD can be used to define subroutines on demand, I am wondering if there is a way to tie a package's stash so that I can intercept access to variables in that package. I've...
Heritage asked 27/4, 2011 at 20:2

2

Solved

I have this little perl script that is supposed to sort a file: #!/usr/bin/perl use strict; use warnings; use Tie::File; tie my @lines, 'Tie::File', 'fileToBeSorted.txt' or die $!; printf "line...
Checkered asked 2/4, 2013 at 20:51

1

Solved

I am working on a project which deals with data in foreign languages. My Perl scripts were running fine. I then wanted to use Tie::File, since this is a neat concept (and saves time and coding). ...
Maratha asked 3/11, 2012 at 13:7

4

Solved

I have the following table structure for a table Player Table Player { Long playerID; Long points; Long rank; } Assuming that the playerID and the points have valid values, can I update the...
Multiversity asked 28/4, 2010 at 6:2

5

Solved

Here's a scenario. You have a large amount of legacy scripts, all using a common library. Said scripts use the 'print' statement for diagnostic output. No changes are allowed to the scripts - they ...
Forecourt asked 22/12, 2008 at 23:6

4

Solved

Given a hash in Perl (any hash), how can I extract the values from that hash, in the order which they were added and put them in an array? Example: my %given = ( foo => '10', bar => '20', b...
Swound asked 3/8, 2010 at 13:13

5

Solved

I often find it useful to be able to schedule code to be executed upon leaving the current scope. In my previous life in TCL, a friend created a function we called defer. It enabled code like: se...
Humiliate asked 21/3, 2009 at 23:7

2

Solved

I've just started to learn about tie. I have a class named Link which I would like to do the following thing: if fetched, return the link's address if stored, store the new address be able to cal...
Watson asked 7/2, 2009 at 18:29
1

© 2022 - 2024 — McMap. All rights reserved.