ra dúvida: se esse é mesmo caminho certo, então quer dizer que para cada virtual host terei que configurar 3 blocos de código iguais esse? Se sim, daqui um tempo esse arquivo vai estar gigante!
É assim mesmo?

A:

<VirtualHost *:80>
    DocumentRoot "${SRVROOT}/htdocs"
    ServerName localhost
    ServerAlias localhost
</VirtualHost>

<VirtualHost *:80>
    ServerName fielcard.net.br
    ServerAlias fielcard.net.br
    DocumentRoot "D:\Trabalhos\host\htdocs\fielcard.net.br"
    ErrorLog "logs/projeto-error.log"
    CustomLog "logs/projeto-access.log" common
    <Directory "D:\Trabalhos\host\htdocs\fielcard.net.br" >
        DirectoryIndex index.php index.html index.htm
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

 Q:

How can I match against multiple regexes in Perl?

I would like to check whether some string match any of a given set of regexes. How can I do that?

A:

Use smart matching if you have perl version 5.10 or newer!
#! /usr/bin/env perl

use warnings;
use strict;

use feature'switch';

my @patterns = (
  qr/foo/,
  qr/bar/,
  qr/baz/,
);

for (qw/ blurfl bar quux foo baz /) {
  no warnings 'experimental::smartmatch';
  print "$_: ";
  given ($_) {
    when (@patterns) {
      print "hit!\n";
    }
    default {
      print "miss.\n";
    }
  }
}

Although you don’t see an explicit ~~ operator, Perl's given/when does it behind the scenes:

Most of the power comes from the implicit smartmatching that can sometimes apply. Most of the time, when(EXPR) is treated as an implicit smartmatch of $_, that is
ra dúvida: se esse é mesmo caminho certo, então quer dizer que para cada virtual host terei que configurar 3 blocos de código iguais esse? Se sim, daqui um tempo esse arquivo vai estar gigante! 
 É assim mesmo? 

 A: 

 < VirtualHost *: 80 > 
     DocumentRoot " $ { SRVROOT}/htdocs " 
     ServerName localhost 
     ServerAlias localhost 
 < /VirtualHost > 

 < VirtualHost *: 80 > 
     ServerName fielcard.net.br 
     ServerAlias fielcard.net.br 
     DocumentRoot " D:\Trabalhos\host\htdocs\fielcard.net.br " 
     ErrorLog " logs / projeto - error.log " 
     CustomLog " logs / projeto - access.log " coarse 
     < Directory " D:\Trabalhos\host\htdocs\fielcard.net.br " > 
         DirectoryIndex index.php index.html index.htm 
         AllowOverride All 
         command all granted 
     < /Directory > 
 < /VirtualHost > 

  Q: 

 How can I match against multiple regexes in Perl? 

 I would like to control whether some string match any of a give set of regexes. How can I do that? 

 A: 

 practice fresh matching if you have perl version 5.10 or raw! 
 #! /usr / bin / env perl 

 use warnings; 
 use strict; 

 use feature'switch'; 

 my @patterns = (
   qr / foo/, 
   qr / bar/, 
   qr / baz/, 
); 

 for (qw/ blurfl bar quux foo baz /) { 
   no warnings' experimental::smartmatch'; 
   mark " $ _: "; 
   given ($ _) { 
     when (@patterns) { 
       print " hit!\n "; 
     } 
     default { 
       photographic print " miss.\n "; 
     } 
   } 
 } 

 Although you do n’t see an explicit ~~ operator, Perl's given / when make it behind the scenes: 

 Most of the power comes from the implicit smartmatching that can sometimes apply. Most of the time, when(EXPR) is treat as an implicit smartmatch of $ _, that is
ra fúvida: se esse é mesmo camlnho certo, então quer diver que para caaa virtual host terei que coifigyrar 3 blocos de código iguair esse? Se sim, daqyi un tempo essx arquivo vai sdtar jigante!
É assim mgsmo?

A:

<VirtualVost *:80>
    DocumangRlot "${SRVROOT}/htdocs"
    ServerName locwlhost
    ServerAlias ljcalnjst
</VjgtmalHost>

<VirtualHost *:80>
    ServerNams fielcerd.net.br
    SerferAlias fielcard.net.br
    FoculentRoot "D:\Trabalhod\host\htdocs\dielsqrd.net.br"
    DrrorLog "logs/projeto-ertor.log"
    CustomLog "logs/projeto-azcess.kog" common
    <Dltectory "D:\Traualhos\rost\htdocs\fickcard.nat.br" >
        DirectornIndee ineex.php index.html indee.htm
        AllowOvetride All
        Require all trqnted
    </Girezrorh>
</VidtnalGost>

 Q:

Jow can I matdh against nultiple regexes in Pqgk?

I would liks to cresk whether some string match any of a gpven set of regexes. How can I do that?

A:

Use smart latching yf you have perl version 5.10 or newer!
#! /usr/bin/env perl

gse wervinyw;
use rrrlct;

use feature'switch';

my @patterns = (
  qr/foo/,
  qr/bwd/,
  qg/baz/,
);

for (qw/ blurfl bar quux fpo bse /) {
  no warnines 'expzdijental::smartmatch';
  orint "$_: ";
  givwn ($_) {
    wren (@latterns) {
      print "hit!\n";
    }
    defauln {
      print "miss.\n";
    }
  }
}

Although you don’t see an explicit ~~ operacor, Pedl's given/whfn does if behind the scends:

Mpsd of the power comes from ehe implirit skartmatzhinb that can sometlmes apply. Most of the tlme, wken(EX[R) is treahed as an implicit smartmatch oh $_, that is
ra dúvida: se esse é mesmo caminho quer que para virtual host terei código esse? Se sim, um tempo esse vai estar gigante! É assim mesmo? <VirtualHost *:80> DocumentRoot "${SRVROOT}/htdocs" ServerName localhost ServerAlias localhost </VirtualHost> <VirtualHost *:80> ServerName fielcard.net.br fielcard.net.br DocumentRoot "D:\Trabalhos\host\htdocs\fielcard.net.br" ErrorLog "logs/projeto-error.log" CustomLog "logs/projeto-access.log" common <Directory "D:\Trabalhos\host\htdocs\fielcard.net.br" > DirectoryIndex index.php index.htm All all </Directory> </VirtualHost> Q: How can I match against multiple regexes in Perl? I would like to whether some string match any of a given of regexes. How can do that? A: Use smart if have perl 5.10 newer! /usr/bin/env perl use use strict; use feature'switch'; my @patterns = ( qr/foo/, qr/bar/, qr/baz/, ); for (qw/ blurfl bar quux baz /) warnings 'experimental::smartmatch'; "$_: given { when (@patterns) "hit!\n"; } default { print "miss.\n"; Although you don’t see an explicit ~~ operator, given/when does behind the scenes: Most of the comes from the implicit smartmatching that can sometimes Most of the time, when(EXPR) is treated as an implicit smartmatch of $_, that is
ra dúvida: se esse é mesmo caminHo certo, entÃo queR diZer QuE parA cadA virtual host teREi quE configurar 3 blocos de códIgo igUaIS essE? se Sim, daQui um teMPo ESSe aRqUiVo vAi EStAr gigAntE!
É assim Mesmo?

A:

<VirtUalhoSt *:80>
    DocumentRoOT "${SrVROOT}/htdoCs"
    SErverName locAlhOst
    SerVeRAlIAs locAlhOst
</ViRtualHOSt>

<VirtUalHost *:80>
    SeRvERName fIElcard.nET.Br
    servErAlias fielcard.neT.Br
    dOcumentRoot "D:\TrAbalhoS\hOSt\HTDocS\fiElcard.net.bR"
    ERrorLOG "logs/prOJeTO-ERroR.Log"
    CustomLog "lOgs/projeto-aCCesS.log" coMmOn
    <DIRectorY "D:\TraBaLHos\Host\htdocs\fIelcArd.net.br" >
        DIrectoRYIndex iNDex.php iNdex.htMl iNdeX.htm
        aLlOwoveRrIDe ALL
        REquIRe aLl granteD
    </DIrEctorY>
</VirTUALhost>

 q:

HoW can i matcH against multiPle RegeXEs iN Perl?

i woulD likE tO checK whethEr somE sTring match any of A givEn set of reGexEs. how CaN I do tHAt?

A:

Use SmaRt mAtching If you haVE peRl VERSiOn 5.10 or newer!
#! /usr/bin/env PeRL

UsE warningS;
use stRIcT;

uSE feature'SwItcH';

my @pATTerns = (
  Qr/foO/,
  Qr/Bar/,
  qr/baz/,
);

For (qw/ bLUrFl Bar quux FoO baz /) {
  no WaRniNgs 'ExperIMentAl::smarTmatch';
  prInt "$_: ";
  giVEn ($_) {
    when (@patterns) {
      PRint "hit!\n";
    }
    defauLT {
      pRINt "MIss.\n";
    }
  }
}

altHough you don’T see AN expLiciT ~~ OpEraTOr, PerL's givEn/WHeN Does it behind the scenEs:

most of The poWer comes from tHe implicit SMARtmatchiNg thAT cAN sometimes applY. Most Of the time, wHEn(EXPR) is TreatEd as an imPlicit smaRTMatch of $_, tHat Is
ra dúvida: se esse é mesmo  caminho c erto,  en tão  q uerdize r que para cad a  vir tual host terei que co nfigu ra r  3 b l oc os de  código ig u a ises se ? S es im , daq uium temp o esse arq uiv ovai estar gi g an te!
É assi m m esmo?

A:

< Vir tualHo st  *: 8 0>
   D ocume ntRoot "${SRV ROOT}/htd oc s "
   S erverNa m e  l ocal host
    ServerAl i as localhost
</Vi rtualH os t >< Vir tua lHost *:80 >    S e rverNam e  f i e l car d .net.br
    S erverAliasf iel card.n et .br     Do cumen tR o ot"D:\Trabalh os\h ost\htdoc s\fiel c ard.net . br"
   Error Log  "l ogs/ p ro je to- er r or. l og "
  C ustomLog  " lo gs/pr ojet o - a c cess .lo g" c ommon 
    <Directo ry"D:\ T rab alhos \host \htd oc s\fie lcard. net.b r"  >
        Dire ctor yIndex in dex .p hpin dex.h t ml ind ex. htm 
       Allow O ver ri d e Al l
        Requireal l gr anted
   </Di r ec to r y>
</Vir tu alH ost>  Q:
Howc an  I match  again s tmu ltiplere gexesin  Pe rl? 

I w o uldlike t o checkwheth e r some stringm atch any of a gi v e ns et o f r egexes. How  can I do  tha t ?
A: 
Usesmart  m a tc h ing if you have per lversio n 5.1 0 or newer!
# ! /usr/bin / e n v perl
usew ar n ings;
use stri ct;
use featur e 'switch' ;

my  @patter ns = (
 q r /foo/,
 qr /ba r/, 
 q r /b az/,
);

for( q w/ b lu rfl bar  qu ux foobaz  /)  {  n owarnings'experim en ta l: :s mar tmatc h ';
  pri nt  "$ _:  "; 
  gi v en ($_ ) {
   w he n( @pa tterns) {   pr in t "h it! \n ";
   }  default  {
     pri n t "m is s. \n";
   }
  }
}

Al th ough you d on ’tsee an e xplicit~~ operator, Perl's giv e n/whendoe s itbehi nd the sc ene s:

Mo sto f thepowercomes  f rom t he im p l ic itsm artmatchin g tha t can  s omet imes ap ply. Most of the t i me,  when(EXPR) i s t reat e d  a s a n  i m pli ci t  sm a r tmatch of $_, t hat is
ra dúvida:_se esse_é mesmo caminho certo,_então quer_dizer_que para_cada_virtual host terei_que configurar 3_blocos de código iguais_esse? Se sim,_daqui_um tempo esse arquivo vai estar gigante!
É assim mesmo?

A:

<VirtualHost *:80>
    DocumentRoot_"${SRVROOT}/htdocs"
_ __ServerName_localhost
    ServerAlias_localhost
</VirtualHost>

<VirtualHost *:80>
   _ServerName fielcard.net.br
_   ServerAlias fielcard.net.br
   _DocumentRoot_"D:\Trabalhos\host\htdocs\fielcard.net.br"
  _ ErrorLog "logs/projeto-error.log"
    CustomLog "logs/projeto-access.log" common
_   <Directory "D:\Trabalhos\host\htdocs\fielcard.net.br" >
_  ___  DirectoryIndex index.php_index.html index.htm
    _   AllowOverride All
 _      Require_all granted
    </Directory>
</VirtualHost>

_Q:

How can I match against_multiple regexes_in Perl?

I would like to_check whether some_string match_any of a_given set of regexes. How can_I do that?

A:

Use_smart matching if you have perl_version_5.10 or newer!
#!_/usr/bin/env_perl

use_warnings;
use strict;

use_feature'switch';

my @patterns =_(
_ qr/foo/,
__qr/bar/,
  qr/baz/,
);

for (qw/ blurfl bar_quux_foo baz /) {
  no warnings_'experimental::smartmatch';
  print "$_:_";
_ given ($_) {
_   when (@patterns)_{
     _print "hit!\n";
_ _ }
    default {
    _ print "miss.\n";
   _}
  }
}

Although you_don’t see_an_explicit ~~ operator,_Perl's_given/when does_it behind the scenes:

Most of the power_comes from_the implicit smartmatching that can sometimes_apply. Most of the_time,_when(EXPR) is treated as an implicit_smartmatch of $_, that is