The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
#!/usr/bin/perl -w
use strict;

# If your version is not properly installed try a line like this one:
#use lib '/home/unixworld/perls';
# This requires you to create an Array subdirectory of /home/unixworld/perls
# place Virtual.pm in this subdirectory.

use Array::Virtual;

my @names;

tie @names, "Array::Virtual", "myarray", 0644;

push @names, "Phil$$", "Chuck$$";
unshift @names, "Lisa$$", "Janet$$";
#my $first = shift @names;
#my $second = pop @names;

#print "pulled $first and $second from list\n";

my $name;

print "number of names: " . scalar @names . "\n";
foreach $name (@names) {
  print "$name\n";
}

if (exists $names[4]) { print "found 4\n"; }