in reply to Variable into list
Here is a self-contained example that demonstrates:
Which prints:#!/usr/bin/perl -l use strict; use warnings; my $string = 'P,F,'; my %letters = map { $_ => 1 } split /,/, $string; for (qw(P F T)) { print "$_ is ", $letters{$_} ? "set" : "not set"; }
P is set F is set T is not set
Cheers,
Darren :)
|
|---|